Question
Critters move around in a world of finite size, but the word is toroidal (going off the end to the right brings you back to the left and vice versa; going off the end to the top brings you back to the bottom and vice versa).
You are allowed to include a constructor for your classes if you want, although it must be a zero-argument constructors (one that takes no arguments).
You are to implement five classes. The behavior of each class is described below.
Class
getChar
getMove
Bird
B
Randomly selects one of the four directions each time
Frog
F
Picks a random direction, moves 3 in that direction, repeat (same as bird, but staying in a single direction longer)
Mouse
M
West 1, north 1, repeat (zig zag to the NW)
Turtle
T
South 5, west 5, north 5, east 5, repeat (clockwise box)
You are allowed to include a constructor for your classes if you want, although it must be a zero-argument constructors (one that takes no arguments).
You are to implement five classes. The behavior of each class is described below.
Class
getChar
getMove
Bird
B
Randomly selects one of the four directions each time
Frog
F
Picks a random direction, moves 3 in that direction, repeat (same as bird, but staying in a single direction longer)
Mouse
M
West 1, north 1, repeat (zig zag to the NW)
Turtle
T
South 5, west 5, north 5, east 5, repeat (clockwise box)
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.