()
| 17 | |
| 18 | |
| 19 | def main(): |
| 20 | print('''Peg Solitaire, by Al Sweigart al@inventwithpython.com |
| 21 | Jump a peg over another and into the empty space. Jumped pegs get |
| 22 | removed from the board. Try to remove as many pegs as you can.''') |
| 23 | |
| 24 | theBoard = getNewBoard() |
| 25 | |
| 26 | while True: |
| 27 | displayBoard(theBoard) |
| 28 | space, jumpDirection = askForPlayerMove(theBoard) |
| 29 | makeMove(theBoard, space, jumpDirection) |
| 30 | if checkIfPlayerHasWon(theBoard): |
| 31 | displayBoard(theBoard) |
| 32 | print('You have solved the puzzle! Thanks for playing!') |
| 33 | sys.exit() |
| 34 | |
| 35 | |
| 36 | def getNewBoard(): |
no test coverage detected