hey all im currently writing this program for class and i need some pointers im not sure what direction to go. im a beginning programmer and i just need some guidance. i have the main body of the program working but once the computer starts his turn it gets a little confusing. im not sure what to check for i must have the computer choose a random number from one of three piles and display it. can anyone point me in the right direction?
// once at the start of main, call this function:
srand( time(0) );
// when you need a random number:
int number = rand() % X; // 0 <= number < X
// when you want to output it:
cout << number;
You may want to take a look at Teach Yourself C++ in 21 Days. While it's pre-standard and not that great, it doesn't assume previous programming experience and it's free.