Write some Software

create the double hog game in python

The game of ‘Double Hog’

You are to construct computer program for a game called ‘Double Hog’

Double Hog is a fun dice game played using two six-sided dice.

Below are the rules for the game.

Players

Usually played between 2 people. However, the program should allow for 2 to 4 players.

Goal

The first person to reach 100 points is the winner.

Gameplay

On a turn, a player rolls the dice repeatedly until either:

• a single 1 is rolled

• the player chooses to hold (stop rolling)

If either of the above occurs, it is the next player’s turn.

Scoring

If a player rolls:

• a single 1 – their turn ends and the total value of both dice is deducted from their score (eg if they throw a 1 and a 3, 4 is deducted from their score; 1+5 will mean 6 is deducted from their score

[NOTE: It is possible for players to have a negative score eg “-6”]

• double 1s – player gets 25 points

• other doubles (eg 2+2, 3+3) – player gets double points (eg 2+2 counts as 8; 3+3 counts as 12; 4+4 counts as 16)

• in all other cases – the player gets the total of both dice (eg 3+4 counts as 7 points; 2+3 counts as 5 points)

Game End

When a player reaches a total of 100 or more points, that player is the winner, and the game ends.

Double Hog Program

General structure of program

1. Greet the user(s) and give a brief description of the game.

2. Show main menu. Example of what could be included in main menu:

a. Play a game

b. See the rules

c. Exit

3. If user chooses to play a game:

a. Ask how many players there are

b. Get names of players

c. Randomly select the order in which players will roll the dice

d. Start game by asking Player 1 to roll the dice when they are ready

e. Display the value of each of the two dice rolled

f. If player has rolled:

• a single 1 – display message indicating the number of points that will be deducted from their score and that it is the next player’s turn; decrement player’s score as per the rules

• two 1s – display congratulations message indicating that they have been awarded 25 points; increment player’s score by 25; display current scores for each player (‘scoreboard’); ask current player if they would like to roll again or hold

• anything else – increment player’s score as per the rules; show scoreboard; ask player whether they want to roll or hold.

g. Repeat (f) as long as Player 1 chooses to roll and they do not roll a single 1.

h. When it is the next player’s turn, repeat (f) and (g), until a player reaches 100 (or more).

i. When a player reaches 100 (or more) - declare them as the winner; ask user whether they would like to play another game, or exit.

4. If the user chooses to see the rules:

a. display rules (NOTE: For the purposes of this task, it is not important that the content of these rules are correct – you could just use ‘placeholder’ text)

b. give the user the option to play a game or exit

Færdigheder: Brainstorming, Python

Om arbejdsgiveren:
( 0 bedømmelser ) New Zealand

Projekt-ID: #14901495

4 freelancere byder i gennemsnit \$44 for dette job

algispetkuns

console style user interface. 8 - 24 hours . completed game / source code in you hands before you pay well commented , well structured code. Relevant Skills and Experience - python - conole games - student assignment Mere

\$85 NZD på 1 dag
(19 bedømmelser)
4.6
Robertxs

Hi, I'm available to do your project, I'm very experienced in python. Contact me on chat Stay tuned, I'm still working on this proposal.

\$46 NZD på 1 dag
(5 bedømmelser)
3.4
mathDev00

Hi, sir! I have a close look to your project. I have a good skill in python programming. If you award this project to me, we'll complete it in time. Our budget may be negotiable Thanks Stay tuned, I'm still working o Mere

\$28 NZD på 1 dag
(3 bedømmelser)
2.2
alamose

I am a computer engineering student and experienced python developer. I'm new to this site so I'm still building my reputation, but I can guarantee I'll deliver quality work as soon as it can be done

\$16 NZD in 2 dage
(4 bedømmelser)
2.1