int main( void ) { srand(time(NULL)); std::string name[10] = { "Stephanie", "Geoffroy", "Ezio", "Thomas", "Hubert", "Matthieu", "Stephane", "Clara", "Gregory", "Aurelien", }; int index = rand() % 10; ZombieEvent one; Zombie* test = one.newZombie(name[index]); index = rand() % 10; Zombie* test1 = one.newZombie(name[index]); test->announce(); one.setZombieType(test, "mangeur"); test->announce(); test1->announce(); delete test; delete test1; return 0; }
int main(void) { Zombie * marvin; Zombie * random; std::cout << "<Main> Creation of a zombie by default" << std::endl; Zombie livingDead; livingDead.announce(); std::cout << std::endl; ZombieEvent event; std::cout << std::endl << "<Main> Adding a type to the existing zombie" << std::endl; event.setZombieType("Hungry"); std::cout << "<Main> Checking the zombie type in the main : [" << event.getZombieType() << "]" << std::endl; std::cout << std::endl << "<Main> Creation of a zombie called Marvin" << std::endl; marvin = event.newZombie("Marvin"); std::cout << "<Main> What is it zombie?" << std::endl; marvin->announce(); std::cout << "<Main> Get away Marvin!" << std::endl; delete marvin; std::cout << std::endl << "<Main> Creation of a random zombie with type Hungry" << std::endl; random = event.randomChump(); std::cout << "<Main> I will destroy you now" << std::endl; delete random; std::cout << "<Main> This is the end, computer always win." << std::endl; return (0); }
int main(void) { ZombieEvent event = ZombieEvent(); Zombie* michael = event.newZombie("michael"); michael->Announce(); delete michael; event.randomChump(); Zombie julie = Zombie("julie", "runner"); julie.Announce(); return (0); }
void wave(ZombieEvent &event, const char *type, int len) { Zombie *tmp; event.setZombieType(type); while (len-- > 0) { tmp = event.newZombie("LAAAL"); tmp->announce(); delete tmp; } }