basically i need a way for the the dice to be counted as the spot e.g. if i roll a 5 it moves to spot 5 and if on the next turn i roll a 3 i would be at spot 8
#include "stdafx.h"
#include <fstream> // writing to files
#include <iostream> // cin and cout
#include <ctime> // time()
#include <cstdlib> // srand() and rand()
using namespace std;
// FUNCTION HEADERS
void roll_the_dice(int &spot);
void spin_wheel(int &spot);
void pick_card(int& spot, int& card);
void choose_card_wheel(int& spot, int& card);
void check_location(int player, int &spot, int &card);
// global variable seen by all functions
// The file will store game events
ofstream outfile("gamelog.txt");
int main()
{
int player;
int player1_spot = 0, player2_spot = 0;
int card_num;
int dice;
srand(static_cast<unsigned int>(time(0))); // seed the generator
do {
outfile << "\nPlayer 1 - Enter 1 to roll the dice." << endl;
cout << "\nPlayer 1 - Enter 1 to roll the dice." << endl;
cin >> player;
roll_the_dice(player1_spot);
check_location(player, player1_spot, card_num);
if (player1_spot >= 90) break;
outfile << "\nPlayer 2 - Enter 2 to roll the dice." << endl;
cout << "\nPlayer 2 - Enter 2 to roll the dice." << endl;
cin >> player;
roll_the_dice(player2_spot);
check_location(player, player2_spot, card_num);
} while ((true)); // *** REPLACE true with proper condition
}
void spin_wheel(int &spot)
{
// *** FILL THIS FUNCTION
}
void pick_card(int& spot, int& card)
{
// *** FILL THIS FUNCTION
}
void choose_card_wheel(int& spot, int& card)
{
int choice;
outfile << "Enter 1 to spin the wheel or 2 to pick a card." << endl;
cout << "Enter 1 to spin the wheel or 2 to pick a card." << endl;
cin >> choice;
if (true) // *** REPLACE true with proper condition
{
spin_wheel(spot);
}
else {
pick_card(spot, card);
}
}
void check_location(int player, int &spot, int &card)
{
int choose;
spot = 0 + 'dice';
outfile << "You landed on spot " << spot << endl;
cout << "You landed on spot " << spot << endl;
if (spot == 30)
{
outfile << "You get the shortcut to 70." << endl;
cout << "You get the shortcut to 70." << endl;
spot = 70;
}
if (spot == 10 || spot == 60)
{
pick_card(spot, card);
}
if (spot >= 90)