Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Homework 1-Robot in Maze Upload your java file to Canvas, and be prepared to run your code for the TA in class on the due

image text in transcribed
Homework 1-Robot in Maze Upload your java file to Canvas, and be prepared to run your code for the TA in class on the due date. Create a robot that moves through your maze. The robot makes random moves up, down, left, and right. It can only see locations that are directly adjacent to its current location. After each move, display the robot in the maze, the number of moves so far, and pause for a moment. Here is an example display. X represents the robot: Move number 138 Begin this homework with your code for the Display Maze lab-Add an array robotPositionl of two integers to store the current row and column of the robo Add a method to determine the new robot position after each random move public static void randomMovel Values maze[JI, int robotPositionI) Use this code to pause the program 1000 milliseconds between each robot move: try ( Thread.sleep(1000); J catch (InterruptedException e) To clear the screen prior to displaying the maze, print 50 blank lines. OPTIONAL (1 bonus point) Make your robot 'smarter, so that it escapes the maze faster. For example, you can give your robot a memory. Ask the user to select 'dumb or 'smart robot before each run. Homework 1-Robot in Maze Upload your java file to Canvas, and be prepared to run your code for the TA in class on the due date. Create a robot that moves through your maze. The robot makes random moves up, down, left, and right. It can only see locations that are directly adjacent to its current location. After each move, display the robot in the maze, the number of moves so far, and pause for a moment. Here is an example display. X represents the robot: Move number 138 Begin this homework with your code for the Display Maze lab-Add an array robotPositionl of two integers to store the current row and column of the robo Add a method to determine the new robot position after each random move public static void randomMovel Values maze[JI, int robotPositionI) Use this code to pause the program 1000 milliseconds between each robot move: try ( Thread.sleep(1000); J catch (InterruptedException e) To clear the screen prior to displaying the maze, print 50 blank lines. OPTIONAL (1 bonus point) Make your robot 'smarter, so that it escapes the maze faster. For example, you can give your robot a memory. Ask the user to select 'dumb or 'smart robot before each run

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions