CSE142 Critter Tournament
Students must submit their critter by 5:00pm Tuesday (8/20) to participate. The in-class tournament will be run as a series of elimination rounds. Each elimination round will take place in a world that is 65 wide and 55 high and will start with:
- 30 of the standard Bear critter
- 30 of the standard Lion critter
- 30 of the standard Giant critter
- 30 of the standard FlyTrap critter
- 60 of the standard Food critter
- 30 each of four different student critters
The simulation will be run for 5000 steps. The critter with the highest count at that point will be declared the overall winner. That critter will then be removed from the simulation and it will be run again for 5000 steps to determine a second place winner. This process can be continued to determine a third place winner, fourth place winner, and so on.
We will run a qualifying contest in advance to pick 16 finalists. In the tournament we run during lecture, we will start with these finalists involved in four rounds. The eight winners will then compete in two rounds. This will lead to the final four who will compete in the final round.
Contestants should pick a name for their critter that is rikely to be unique (e.g., NatsuharaHusky). In each lecture prizes will be given out to the top four winners along with one prize for "most entertaining," but you have to be present to win your prize.
Twelve of the finalists will be picked through a precontest. We will generate all combinations of three contestants and put them in a world that matches the description above (including the Bear, Lion, Giant, FlyTrap, and Food critters listed above). For each combination of three contestants, we will run a simulation for 5000 steps and add the final critter counts to each critter's total score. The twelve critters with the highest totals will be included in the lecture contest.
We will also have a contest to pick four "entertaining" critters. A group of TAs will judge the entries. These critters will be included in the lecture tournament. If one of the winners of the entertaining contest is also among the top twelve critters in the precontest, then additional top winners from the precontest will be added to reach a total of sixteen finalists.
Any submission that is found to be circumventing the spirit of the contest will be disqualified (e.g., trying to access the critter model or critter frame, trying to read or write files, trying to open a network connection, trying to exit the program, including offensive images or language, etc). Submissions will also be rejected if they take an inordinate amount of time to execute. You are restricted to the programming constructs described in chapters 1 through 10 of the textbook.
You are allowed to turn in a different critter for the contest than what you turn in for homework 8.
You can create interesting behavior by using static fields. When you add the "static" keyword to a field, there will be just one version of that field that is shared by all objects of the class. For example, you could make an ArrayList that is shared by all of your critters. But static fields pose a problem for running simulations repeatedly because you want to start with appropriate values for each new simulation. If you are going to use static fields, you should include a static method called initStatic that takes no arguments. If it exists, the simulator will call this method once before the beginning of each simulation. You can find an example of a critter class that uses a static field by looking at Food2.java, a variation of the Food critters that display themselves with text such as "7 of 9" to indicate that this is the 7th such critter out of a total of 9 ever created.
Submit your critter class here:
You must include your name in the comments for your husky class and you may not use the name "Husky" for your class. Make sure that your critter class compiles after you change the name (remember that the constructor name must match the class name). Submissions are due at 5:00pm on Tuessday.