(5/5)

# 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.

INSTRUCTIONS TO CANDIDATES

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
>>>
=== 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
```
(5/5)

## Related Questions

##### . Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

##### . The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

##### . Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

##### . SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

##### . Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Hire Me

Hire Me