Kapalı

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

Beceriler: Beyin Fırtınası, Python

Daha fazlasını görün: write some software create an app, https://wwwfreelancerin/projects/php/write-astrology-software-create-reports/, free software pick name randomly, software create unique content blog, software create video spokesperson, best easiest software create oscommercegif site logo, nda software create, software create magazine, software create template joomla, software create restaurant menu card, write software functional description pdf, software create phone verified accounts, create shop heading names logo, free english speaking write software

İşveren Hakkında:
( 0 değerlendirme ) New Zealand

Proje NO: #14901495

4 freelancer bu iş için ortalamada 44$ teklif veriyor

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 Daha fazlası

1 gün içinde 85$ NZD
(19 Değerlendirme)
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.

1 gün içinde 46$ NZD
(5 Değerlendirme)
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 Daha fazlası

1 gün içinde 28$ NZD
(3 Değerlendirme)
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

in 2 gün içinde16$ NZD
(4 Değerlendirme)
2.1