project in Python(code)
You need to create an application that plays a standard 01 dart game. With a standard 01 game, the starting score is given (usually 501 or 301). Each throw’s points will decrease that starting score until it reaches exactly 0. If the throw’s points make the player’s score below 0, the score will be reset to the current score before the throw. For example, if your current score is 10 and you throw a 15, making the score below zero, the player has "bust", and the score will be reset to 10.
The dart game will use the random module to help make fake throws to the dart board. Remember, a dart board has the following points available: 0 (a miss), 1 through 20, 25 (bull), and 50 (bull’s eye). Also, 1 through 20 can be doubled or tripled. For 1 through 20, expect that there is a 5% chance that the score will be tripled and a 10% chance that the score will be doubled on the throw.
Create two scripts: dart_game.py and dart_board.py. dart_game.py will simply call the function play_standard_01 in dart_board.py to play the dart game, and then dart_game.py will output the number of throws required for the game.
Aucun commentaire:
Enregistrer un commentaire