code is
Code:
// Slot Machine Game - Tester
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main()
{
int z, 1, 2, 3, tokens=6;
srand(time(0));
cout<<"\t Welcome to slots\n"
<<"\t Type 1 to play, 2 not to play\n";
cin>>z;
while(tokens!=0)
{
cout<<"You have "<<token<< " tokens Left\n\n"
<<"Pull Lever? (1 to pull, 2 not to pull)\n\n";
cin>>z;
if(z==1)
{
1 = 1+rand() %10;
2 = 1+rand() %10;
3 = 1+rand() %10;
cout<<"\t\t"<<1<<" "<<2<<" "<<3<<"\n\n";
}
else
cout<<"OK!!!\n";
{
if(1==2==3)
{
tokens+=2;
cout<<"Congrats, You win\n\n";
}
if(1==2 || 2==3 || 1==3)
{
tokens+=1;
cout<<"You got ttwo out of three\n\n";
}
else
{
tokens-=1;
cout<<"Better luck next time! You loose!\n\n";
}
}
}
system("PAUSE");
return 0;
}
getting big error
Code:
------ Build started: Project: slot, Configuration: Debug Win32 ------
Compiling...
slot.cpp
.\slot.cpp(9) : error C2059: syntax error : 'constant'
.\slot.cpp(18) : error C2065: 'tokens' : undeclared identifier
.\slot.cpp(18) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Build log was saved at "file://c:\Documents and Settings\Reece.LAPTOP\My Documents\Visual Studio 2005\Projects\slot\slot\Debug\BuildLog.htm"
slot - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========