void Critter::PerformTrick() { if(GetMood() != "happy") { std::cout << "I dont feel like doing a trick" << std::endl; return; } RandGen rg; unsigned choice = rg(NUM_TRICKS); std::cout << "\n\nI " << TRICKS[choice] << " .\n"; PassTime(); }
void Critter::Talk() { cout << "I'm a critter and I feel "; int mood = GetMood(); if (mood > 15) { cout << "mad.\n"; } else if (mood > 10) { cout << "frustrated.\n"; } else if (mood > 5) { cout << "okay.\n"; } else { cout << "happy.\n"; } PassTime(); }
void Critter::Talk() { std::cout << "I'm a Critter and I feel " << GetMood() << ".\n"; PassTime(); }