Hello, I am new to this forum, and I am interested on making games. I have started with making a board game or something similar to it. Can someone help me improve it, and give me ideas for making more chanllenging?? Please.
Code:
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main() {
cout<<" THIS IS A BOARD GAME, PLAY WELL GRASSHOPER"<<endl;
int die;
const int LOW=1;
const int HIGH=6;
time_t seconds;
time(&seconds);
srand((unsigned int)seconds);
die=rand()%(HIGH-LOW+1)+LOW;
cout<<"Do you want to roll first?"<<endl;
int first_player=0;
int second_player=0;
char answer;
cin>>answer;
switch(answer)
{
case 'y':
cout<<"You roll a "<<die<<" , you move "<<die;
cout<<" space(s) on the board"<<endl;
first_player+=die;
break;
case 'n':
cout<<"You choose your opponent to be first"<<endl;
cout<<"He rolls a "<<die<<" . He moves "<<die<<" space(s) on the board"<<endl;
second_player+=die;
break;
default:
cout<<"Terminating Program"<<endl;
cout<<"Error Occured"<<endl;
}
switch(answer)
{
case 'y':
cout<<"Now is the turn of your opponent"<<endl;
die=rand()%(HIGH-LOW+1)+LOW;
cout<<"He rolls a "<<die<<" , he moves "<<die<<" space(s) on the board"<<endl;
break;
case 'n':
cout<<"Now is your turn"<<endl;
die=rand()%(HIGH-LOW+1)+LOW;
cout<<"You roll a "<<die<<" you move "<<die<<" space(s) on the board"<<endl;
break;
default:
{
cout<<"Error Occured"<<endl;
}
}
return 0;
}
Thanx everyone for even seeing me post.