Малышка, хош мейк лав? Тогда скажи мне почему у меня код не компайлится:Originally Posted by Malishka
#include "stdafx.h"
#include <iostream>
using std::cout;
using std::cin;
#include <cstdlib>
using std::rand;
using std::srand;
class Game
{
};
class Player
{
};
int _tmain(int argc, _TCHAR* argv[])
{
Game g;
Player p;
int guess;
int tries;
bool isCorrect;
for (int times=0; times < 10; times++)
{
g.pickRandomNumber(times);
tries = 0;
isCorrect = false;
cout << "I have a number.\n";
do
{
cout << "Player will guess a number between 1 and 100: ";
guess = p.pickNumber();
cout << guess << "\n";
isCorrect = g.guessNumber(guess);
if (isCorrect == true)
{
tries = g.getTries();
cout << "Player got it in " << tries << " tries!\n\n";
p.keepScore(tries);
}
else
{
cout << "Nope. Player didn't get it\n";
}
} while (isCorrect == false);
}
cout << "Player's average is: " << p.getAverage(10) << "\n";
cin >> guess;
return 0;
}



Reply With Quote