DigiPeg Solitaire, the user can specify how many rows [1-9] and how many columns [1-9] the board should have. pegs can jump over an adjacent peg into an empty space.Python Programming

Four empty functions in a Python program - everything else is written and cannot be changed.  Output must be able to match the attached transcripts.

How it's supposed to work:

In DigiPeg Solitaire, the user can specify how many rows [1-9] and how many columns [1-9] the board should have.

In DigiPeg Solitaire, pegs can jump over an adjacent peg into an empty space. The jumping peg, the adjacent peg, and the empty space must be in a straight line as in Peg Triangle Solitaire. The potential direction for a peg to jump is over, under, left, or right.

When a jump is made the adjacent peg (the peg that was jumped over) is removed.

The game is over when no more moves are possible.

When 2 or fewer pegs remain when the game ends, the message "You're a DigiPeg Genius!"

When 3 or 4 pegs remain, the message "Not too shabby, rookie."

When 5 or 6 pegs remain, the message "That's nothing to write home about."

When 7 or more pegs remain, the message "You're a DigiPeg Igno-Ra-Moose"

 

 

Python 3.8.2 (v3.8.2:7b3ab5921f) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
=== RESTART: /Users/danieldefrance/Desktop/program5/Daniel-DeFrance-Prog5.py ===
Welcome to Peg Rectangle Solitaire!
-----------------------------------

Enter the number of rows [1 - 9]: 4
Enter the number of columns [1 - 9]: 4
Enter the empty space row [1 - 4]: 2
Enter empty space column [1 - 4]: 2

    1   2   3   4  
  +---+---+---+---+
1 | o | o | o | o |
  +---+---+---+---+
2 | o |   | o | o |
  +---+---+---+---+
3 | o | o | o | o |
  +---+---+---+---+
4 | o | o | o | o |
  +---+---+---+---+

Enter the row of the peg to move [1 - 4]: 2
Enter the column of the peg to move [1 - 4]: 4
Enter the row where the peg lands [1 - 4]: 2
Enter the column where the peg lands [1 - 4]: 2

    1   2   3   4  
  +---+---+---+---+
1 | o | o | o | o |
  +---+---+---+---+
2 | o | o |   |   |
  +---+---+---+---+
3 | o | o | o | o |
  +---+---+---+---+
4 | o | o | o | o |
  +---+---+---+---+

Enter the row of the peg to move [1 - 4]: 2
Enter the column of the peg to move [1 - 4]: 1
Enter the row where the peg lands [1 - 4]: 2
Enter the column where the peg lands [1 - 4]: 3

    1   2   3   4  
  +---+---+---+---+
1 | o | o | o | o |
  +---+---+---+---+
2 |   |   | o |   |
  +---+---+---+---+
3 | o | o | o | o |
  +---+---+---+---+
4 | o | o | o | o |
  +---+---+---+---+

Enter the row of the peg to move [1 - 4]: 4
Enter the column of the peg to move [1 - 4]: 1
Enter the row where the peg lands [1 - 4]: 1
Enter the column where the peg lands [1 - 4]: 1
Sorry.  That move is not allowed.

    1   2   3   4  
  +---+---+---+---+
1 | o | o | o | o |
  +---+---+---+---+
2 |   |   | o |   |
  +---+---+---+---+
3 | o | o | o | o |
  +---+---+---+---+
4 | o | o | o | o |
  +---+---+---+---+

Enter the row of the peg to move [1 - 4]: 4
Enter the column of the peg to move [1 - 4]: 1
Enter the row where the peg lands [1 - 4]: 2
Enter the column where the peg lands [1 - 4]: 1

    1   2   3   4  
  +---+---+---+---+
1 | o | o | o | o |
  +---+---+---+---+
2 | o |   | o |   |
  +---+---+---+---+
3 |   | o | o | o |
  +---+---+---+---+
4 |   | o | o | o |
  +---+---+---+---+

Enter the row of the peg to move [1 - 4]: 3
Enter the column of the peg to move [1 - 4]: 3
Enter the row where the peg lands [1 - 4]: 3
Enter the column where the peg lands [1 - 4]: 1

    1   2   3   4  
  +---+---+---+---+
1 | o | o | o | o |
  +---+---+---+---+
2 | o |   | o |   |
  +---+---+---+---+
3 | o |   |   | o |
  +---+---+---+---+
4 |   | o | o | o |
  +---+---+---+---+

Enter the row of the peg to move [1 - 4]: 1
Enter the column of the peg to move [1 - 4]: 3
Enter the row where the peg lands [1 - 4]: 3
Enter the column where the peg lands [1 - 4]: 3

Attachments:

Instructions Files

Expert's Answer

OR

Python Programming Experts

expert
Issac Torres
Python Programming

67 Answers

expert
Oliver
Python Programming

60 Answers

View More Experts
Disclaimer

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.

Get Free Quote!

257 Experts Online