Python program designed to score various darts games from the command line
During COVID, some buddies and I began playing darts over zoom. I created this program so that I should share my screen and we could easily score various dart games.
** 2/1/2022 I've added a play-against-the-computer mode where you can specify the desired level of opposition for Legs, Golf, X01, and Cricket
** August 2022 - Streamlined menu, added undo functionality to training mode and cutthroat, fixed bug in multiplayers mode for games eligible for training, added error message for exception handling, enhanced scratch bringback functionality for cutthroat, added around the world for multiplayer and training, added training mode for follow the leader, added ability to save training history.
The program is admittedly not super intuitive, so I've included some detailed instructions on how to use
-- At startup, enter player names with comma and space separating
-- Example:
-- Player1, Player2
-- Teams are randomly assigned for games so no need to worry about input order
-- If only one player is provided, you will then be prompted to specify the level of computer opponent you wish to play
-- If you want to play against multiple computer opponents, you can add multiple players with the name "Opponent", and training mode defaults to beginner
-- darts are scored with a lowercase 't','d','s' and then the number scored and a comma separating darts
-- here is an example of triple 20, 19, 18 in the same turn
t20,t19,t18
-- if an error is thrown the user will be reprompted to enter the darts
-- if you accidently score the wrong darts you can type "undo" and the previous turn will be restored
-- if you miss all three darts you can type "miss" to advance to the next turn
-- to exit the game you can type "exit"
-- same instructions as cricket
-- same instructions as cricket
-- after entering your darts you will be prompted for an extra score
-- this is providing you the option to record points scored on a closed triple, double or bed
-- for example, let's say I've closed 20s as has my opponent, but I've also closed beds
-- if I hit three single 20s I would score my turn as "miss" and then enter 60 as the extra score to be scored
-- simply enter the number of points scored on that turn
-- played starting at 20 working down to 1, singles advance one number, doubles two, triples three
-- after hitting 1, you must hit three bullseyes to win
-- played with continuation, where if the final dart in a turn hits, that player's teammate immediately follows to continue the turn
-- also played with redemption, where once a team hits three bulls, the other team has one more turn to try to match
-- for scoring, simply enter the last number you've hit, and for bulls enter the number of bulls as capital Bs (e.g. B, BB, BBB)
-- simply enter the number of points scored on that turn
-- darts are scored with a lowercase 't','d','s' and then the number scored and a comma separating darts
-- if the dart is missed type "miss", if it is hit then input the new dart to hit
-- for example if the dart to hit is single 20, and I hit this dart and then a double 5, I would simply enter d5
-- simply enter the number of points scored for that hole
-- enter comma separated inputs with the following order:
-- number of own darts hit, player targeted, number of their darts hit
-- this can be repeated for multiple other players targeted
-- for example let's say I have 2 lives and each of my opponents has 1 life left
-- I could win the game with the following sequence:
-- 1,Player 2,1,Player 3,1
-- same instructions as cricket
-- for those unfamiliar this is a multi-player version of the game where the goal is to have the lowest number of points
-- for example: if I've closed 20s and no one else has and I hit a single 20, then my score remains the same but all of my opponents have their scores increased by 20
-- this game is modeled off of the multi-player pool game cutthroat
-- entering your darts follows the same approach as cricket
-- the goal is to hit other player's numbers without hitting your own
-- if you do hit your own number you will have scratched, and your opponents will each get to bring that many darts back
-- currently you can only bring darts back on a single numbers per person, but I may expand the functionality so you can add scratch darts back to multiple numbers
-- for example if an opponent scratches hitting a triple being able to bring back 1 live on three separate numbers rather than 3 on a single number
-- moving this program from the command line to the browser, and then potentially hosting on a server and allowing clients to access directly rather than through screen share
-- adding user profiles and history, so that statistics can be tracked across sessions and league-style play can be supported
-- adding an AI-based training mode where opponent play is simulated and is adaptive to the user's performance