When I try to compile this:
//Player Class Definitions
#include <iostream>
#include "player.h"
using namespace std;
player::player()
{
health = 100;
level = 1;
potions = 10;
enemiesDefeated = 0;
}
int player::attack(int *enemyHealth)
{
srand(time(NULL));
int randomNumber = rand() % 100;
*enemyHealth = *enemyHealth - randomNumber;
}
int player::heal(int *playerHealth)
{
if (potions > 0)
{
srand(time(NULL));
int randomNumber = rand() % 100;
if (randomNumber <= 30)
{
health = health + 10;
}
else if (randomNumber >= 31 && <= 59)
{
health = health + 20;
}
else if (randomNumber >= 60 && <= 80)
{
health = health + 30;
}
else
{
return 0;
}
}
}
in Dev-C++, i get the error: "expected primary-expression before '<=' token". What does this mean? How can I fix it?
Thanks in advance,
EpicAsian