Craps game C++ need help??

For this program, simulate a craps game for a total of at most 20 wagers. That is, the first player rolls
the dice until he either wins or loses. That is the first wager. The winner then takes the dice, and rolls
until the second wager is decided. And so on, for a total of 20 wagers. However, if one of the
gamblers loses all of his money before the 20th wager, end the simulation at that point.
Assume that each player starts out with a balance of $1000. Assume also that when player 1 is rolling,
he always bets $100 on each wager. However, player 2 believes in luck and uses a strategy of his own
creation. When he has the dice and it is his turn to decide how much to bet, he considers how much
money he has. If he has at least as much money as he had when the game began, he decides his luck is
good and bets $150. If he has less money than when the game began, he decides his luck is bad, and
only bets $50 on that particular wager. Player 1 always rolls the dice first in this simulation.
You must use a pseudo-random number generator to simulate a dice roll. Use the DrawNum function
in the Lottery program handout. You may copy and paste it directly into your program 4 code, citing
the source in your comments. To simulate the roll of one die, call the DrawNum function once, with a
maximum roll of 6. Since the game is played with two dice, to simulate one roll you will have to
generate two numbers by calling DrawNum twice and then adding the two numbers together.
Your program must print out a roll-by-roll description of what happens as the game is played.

Sample out: Wager 1 : Bet is $100
Player 1 is rolling the dice
The roll is 2
That is craps! Player 1 loses.
Currently, Player 1 has $900 and Player 2 has $1100.

Wager 2 : Bet is $150
Player 2 is rolling the dice.
The roll is a 6. The point is 6. Player 2 rolls again.
The roll is a 5. The point is 6. Player 2 rolls again.
The roll is a 6. That is the point! Player 2 wins.
Currently, Player 1 has $750 and Player 2 has $1250.
This should be in the Beginners' section.

What have you programmed so far, or do you need help getting started? If the former, how can we help?

-Albatross
Just need help getting started.
I made this program for you that might help. It randomly generates a number and if you guess it right you win. I hope this is similar to what you're doing. Good luck!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>

using namespace std;

int main()
{
    srand(time(NULL));

    int dice = ("%10d", 1 + (rand() % 6));

    cout << "guess the number" << endl;
    int numberguess;
    cin >> numberguess;
    cout << "the number was: " << dice << endl;

    if (numberguess == dice)
    {
        cout << "you win!";
    }
    else
    {
        cout << "you lose.";
    }

    return 0;
}
Topic archived. No new replies allowed.