İ don't Know english well so i will try to tell with my best.
I wrote these codes but it's sure it's not working well. And it's killing me that can't find what the problem is!!
#include<iostream>
using std::cout;
using std::endl;
using std::cin;
main()
{
int a,d1,d2;
char dice,startgame;
cout<<"To Start Please Push A Button!"<<endl<<"Waiting..."<<endl;
cin>>startgame;
if(startgame=='a'||startgame=='A){
cout<<"To Dice Please Push Button Z!"<<endl<<"Waiting..."<<endl;
while(a=1;a<=1000;a++){
cin>>dice;
if(dice=='Z'||dice=='z'){
d1=1+(rand()%6);
d2=1+(rand()%6);
cout<<" First Dice :"<<d1<<endl<<" Second Dice :"<<d2<<endl;}
else
cout<<"Error :Only Z Button can dice"<<endl;
else{
cout<<"Wrong Button!!!"<<endl;
return main();}
}
What i want to do is here. http://imageshack.us/photo/my-images/96/skillingme.jpg
I just want to make a program that doing randoming two dice depend on a time 0<time<37
Try to line up your code so it is easier to read, maybe space it out.
Then you can maybe see what is wrong, but the error codes should tell you what you need to do.
You are missing quotation marks and closing braces.
#include<iostream>
using std::cout;
using std::endl;
using std::cin;
int main()
{
int a,d1,d2;
char dice,startgame;
cout<<"To Start Please Push A Button!"<<endl<<"Waiting..."<<endl;
cin>>startgame;
if(startgame=='a'||startgame=='A')
{
cout<<"To Dice Please Push Button Z!"<<endl<<"Waiting..."<<endl;
while(a=1;a<=1000;a++)
{
cin>>dice;
if(dice=='Z'||dice=='z')
{
d1=1+(rand()%6);
d2=1+(rand()%6);
cout<<" First Dice :"<<d1<<endl<<" Second Dice :"<<d2<<endl;
}
else
cout<<"Error :Only Z Button can dice"<<endl;
}
}
else
{
cout<<"Wrong Button!!!"<<endl;
return main();
}
}
I have turn it to this And it still gives error and the error is 'expected before token )' in line 17. I m saying i couldn't find the problem. i don't know enough becouse i m a beginner.