The Mind Of Sauron
From Huben's Wiki
Line 1: | Line 1: | ||
− | + | We are going to write a sizable class, compile it, and run it. The goal is to get the variable and method declarations right and the arguments and returns right. | |
− | + | ||
− | We are going to write a sizable class, | + | |
When writing variable declarations, you need to consider: | When writing variable declarations, you need to consider: | ||
Line 29: | Line 27: | ||
* Methods: | * Methods: | ||
** A method printing an evil cackle. | ** A method printing an evil cackle. | ||
− | ** A method dispatching a number of ringwraiths to a location name. | + | ** A method dispatching a number of ringwraiths to a location name. (It doesn't have to do anything, just have the arguments.) |
+ | ** A method for chanting a spell. Its argument is an array of words, three in number. It should call another method for each word that will print the word twice. | ||
+ | ** A method for calculating the number of Hobbits needed as food by a number of Orcs and a number of Uruk-Hais over some number of days. | ||
+ | ** A main() method. | ||
+ | *** Start with a cackle! | ||
+ | *** Chant the spell in your field, then chant another spell you make up. | ||
+ | *** Print the number of Hobbits needed as food for your army every week. | ||
+ | *** Print the number of Hobbits needed as food for your army every week if you double the number of Orcs. |