Craps in Python Part 2: Program

preview_player
Показать описание
An introduction to writing a Craps program in Python based on pseudocode
Рекомендации по теме
Комментарии
Автор

Respect!
Thank you for sharing and also for being BRILLIANT.

haditube
Автор

#please solve this one

In the casino game of Lucky Sevens, the player rolls a pair of dice. If the dots add up to 7, the player wins $4; otherwise, the player loses $1.

Suppose that, to entice the gullible, a casino tells players that there are lots of ways to win: (1, 6), (2, 5), and so on.

A little mathematical analysis reveals that there are not enough ways to win to make the game worthwhile.

However, because many people’s eyes glaze over at the first mention of mathematics, your challenge is to write a program that demonstrates the futility of playing the game. So...

Write a computer version of Lucky Sevens game!

Your program should take as input the amount of money that the player wants to put into the pot.

After each roll, the program should:

a. Check if the dots add up to 7: if yes, the player wins $4; otherwise, the player loses $1;

b. Notify the player about loosing or winning money on the roll;

c. On each winning roll, tell the player how many rolls it took this time to win since the last winning roll (or since the beginning of the game if this is the very first win);

d. Display the current amount of money in the pot.

e. Optional: Ask the gamer if they want to play another round.

f. The game should play until the pot is empty.

g. Once the pot is empty, the game should stop rolling dice, notify the gamer that no more money is left, and print the total number of rolls it took to break the player (total amount of rolls since the beginning).

MostafaJamil-zwzq
Автор

This keeps giving me an error and I' getting frustrated!!

VirgoAsphyxia
Автор

richard how to simulate crap game in condition that
Upon request to the user of the number of simulations (an integer) 1
.
(B) If this number is <= 0, displays DONE and the program ends.
(C) If this name is greater than on poster TOO LARGE, and on request again
A number
(D) Otherwise, the program executes the number of simulations requested.

firassbensaid
Автор

I have the exact same code and the loop continues without telling me if I win or lose. Can I send you a private message so you can see my code?

BGGX
Автор

I don't get what the point is can someone explain pls. Thanks

AcousticDreamer
join shbcf.ru