I need help writing a program....
You are to write a python program to accomplish the following:
a.. Play a dice game of Craps using a random number generator to simulate
the roll of the dice, the code for the rolling of the dice should take place
in a user written module named rolldice.
b.. The rules of the game are as follows:
a.. 1st roll, a score of 7 or 11 wins.
b.. 1st roll, a score of 2, 3, or 12 loses.
c.. 1st roll, any number other than those listed above becomes the goal
number, you must keep rolling until you roll the goal number again. If a 7
is rolled before you goal number, you lose.
Make the game continuous, until you tell it to stop. You can bet the same
amount, or change you bet after each win or loss. Print the results of each
roll and the running total of winnings or loses.
plz help!!!
1 6224
I need help writing a program....
You are to write a python program to accomplish the following:
a.. Play a dice game of Craps using a random number generator to simulate
the roll of the dice, the code for the rolling of the dice should take place
in a user written module named rolldice.
b.. The rules of the game are as follows:
a.. 1st roll, a score of 7 or 11 wins.
b.. 1st roll, a score of 2, 3, or 12 loses.
c.. 1st roll, any number other than those listed above becomes the goal
number, you must keep rolling until you roll the goal number again. If a 7
is rolled before you goal number, you lose.
Make the game continuous, until you tell it to stop. You can bet the same
amount, or change you bet after each win or loss. Print the results of each
roll and the running total of winnings or loses.
plz help!!!
We cannot write the whole thing for you but for the dice use something like: -
import random
-
-
dice1 = random.randint(1, 6)
-
dice2 = random.randint(1, 6)
-
print dice1, dice2
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Alexander Ross |
last post by:
PHP/POSTGRESQL
Here's the cliff's notes version of my situation:
I'm makeing a simple role playing game where users gain points by answering
trivia question. They can then use their points (like skiball tickets) to
attepmt certain actions. Success ot failure is based on a roll of the dice.
If successfull, the users personal stats (i.e. knowledge (kn), charisma (ch)
.... basically think back to the hayday of Dungens & Dragons) increase...
|
by: Jia Sun |
last post by:
hello , everybody , i need a similar program , just like
fancyimport.com
if possible, pls contact me ,thank you very much .
inchina@gmail.com
|
by: googlegroups |
last post by:
Hi, I'm making a javascript program for rolling dice for a roleplaying
game that's played in a forum. The die roll gets generated, gets stored
as text in a hidden form field, and then gets written to the mySQL
database upon form submission.
What I want to do is prevent cheaters from being able to create their
own die roll, and the best way I've come up with to do this is to
encrypt what gets stored in the hidden form field. However,...
|
by: ramasubramanian.rahul |
last post by:
hi folks
i have a peculiar problem. i have to allocate more than size_t
consequtive bytes on a system . after i do a malloc .. i am unable to
do a realloc because it takes size_t as a new size and not as an
incremental size..
can you tell me which library/system call to use..
Plz consider that all the physical hardware req for such an operation
is available... i know this sounds crazy... but just help me out here
....
Thanks in Advance
|
by: IRCHICKEN |
last post by:
There's something strange about it.
In my InitGui() methode he thinks my game object still has null values but in my actionperformed method I can use the game object.
public class FightJPanel extends javax.swing.JPanel {
private TestFrame main;
private HeroQuest game;
private JLabel jLabelHero;
private JButton jButtonDice;
public FightJPanel(TestFrame frame, HeroQuest hero) {
super();
| |
by: Skybuck Flying |
last post by:
Hello,
This morning I had an idea how to write Scalable Software in general.
Unfortunately with Delphi 2007 it can't be done because it does not support
operating overloading for classes, or record inheritance (records do have
operator overloading)
The idea is to write a generic integer class with derived integer classess
for 8 bit, 16 bit, 32 bit, 64 bit and 64 bit emulated.
|
by: sunnydude |
last post by:
Anybody know how to write a 3 dice rolling program like this
Sample output
Welcome to the dice roller!
First of all, please enter a seed for the random number generator. This should be a positive integer: 3
How many times would you like me to roll the 3 dice?
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |