Question: java code problem level: introduction to java just the method move() no GUI RotateClockwise() and moveRight() Direction.java move0 void move (Direction direction) To move in
java code problem
level: introduction to java
just the method move() no GUI

RotateClockwise() and moveRight()

Direction.java

move0 void move (Direction direction) To move in any direction in Streamline is simpler than it seems! We can use rotateClockwise) and moveRight() in conjunction with each other instead of implementing methods for every single direction. 1. Rotate some number of times to orient the Snake in the right direction. 2. Move right (until you hit an edge/block/goal) 3. Rotate back to the original board position/orientation. How many times should you rotate this time? Hints Take a look at Direction.java. It has an instance variable for how many times you should rotate - - Read over the general algorithm carefully and see the diagram below for more detail. - Read the FAQ on the first page if you are confused about how to use enums in Java. S G How do we move up? S Snake G: Goal 0 1 Rotate board 2 Move Snake 3 Rotate board clockwise once right clockwise 3 times to original position void rotateClockvise) l int[]l tempBoard -ne int[board. length][board. length]: for (int 1-0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
