I really don't know how to implement this Spin the wheel function, it's supposed to send a player backwards or forwards a certain amount of spots
// boardgame1.cpp : Defines the entry point for the console application.
//
#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
}
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)
srand(time(NULL));
just do this once in your program somewhere, not all over the place. Its not "wrong" its just not the intent. The intent is to seed once and use the stream of values from that.
I don't see an issue, except you stopped coding... spin function looks ok as far as it goes but needs code for all values 1-8, right? What isn't right about it?