## R4zrF1r3

#include <iostream>

using namespace std;

//-----------------------------------------------------------------------------
void UserMove(int &NumStones)
/* Pre: NumStones > 0
Post: User has taken 1, 2, or 3 stones from pile */
{
cout << "How many would you like? ";
int TakeStones;
cin >> TakeStones;
while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones) {
cout << "Value must be between 1 and 3" << endl;
cout << "How many would you like? ";
cin >> TakeStones;
}
NumStones-=TakeStones;
}
//-----------------------------------------------------------------------------
void ComputerMove(int &NumStones)
/* Pre: NumStones > 0
Post: Computer has taken 1, 2, or 3 stones from pile */
{
int TakeStones;
do {
TakeStones=1+random(3);
} while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones);
cout << "The computer takes " << TakeStones << "." << endl;
NumStones-=TakeStones;
}

int main()
{
UserMove();
ComputerMove();
system("PAUSE");
return 0;
}

## VernonDozier 2,218

#include <iostream>

using namespace std;

//-----------------------------------------------------------------------------
void UserMove(int &NumStones)
/* Pre: NumStones > 0
Post: User has taken 1, 2, or 3 stones from pile */
{
cout << "How many would you like? ";
int TakeStones;
cin >> TakeStones;
while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones) {
cout << "Value must be between 1 and 3" << endl;
cout << "How many would you like? ";
cin >> TakeStones;
}
NumStones-=TakeStones;
}
//-----------------------------------------------------------------------------
void ComputerMove(int &NumStones)
/* Pre: NumStones > 0
Post: Computer has taken 1, 2, or 3 stones from pile */
{
int TakeStones;
do {
TakeStones=1+random(3);
} while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones);
cout << "The computer takes " << TakeStones << "." << endl;
NumStones-=TakeStones;
}

int main()
{
UserMove();
ComputerMove();
system("PAUSE");
return 0;
}

Function in line 6 expects a parameter. Your function call does not provide one in line 35. Same thing for your function call in line 36. you need to define an integer in main, then pass that integer to each function in your function calls. Initialize this variable to be the number of stones that exists before the game starts, then call your functions.