Advertisement
2002ASP Object Oriented Programming (OOP) #5881

Eater Polymorphism Example

Probably useful if you want to learn about polymorphism, objects and collections. This is an example of polymorphism running out of control. 1000 generic Beast-class objects are created, each assigned to be either a Dog, Cat, or Mouse. Then, using calls to the Beast class, they try to eat each other, until only one (the biggest) remains. Try messing around with it ... a larger animal can only eat a smaller one, except in the case of mice who can eat an animal of the same size - it's only fair, they start so small.

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
Upload
Původní komentáře (3)
Obnoveno z Wayback Machine