Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

board.txt _____X____ _______X__ _______X__ X____X____ _X________ __X___X___ _________X ___X__X___ ___X______ __XX______ robotCommands.txt Move Right Move Down Move Down Move Down Move Right Move Right Move

image text in transcribed

board.txt _____X____ _______X__ _______X__ X____X____ _X________ __X___X___ _________X ___X__X___ ___X______ __XX______

robotCommands.txt

Move Right Move Down Move Down Move Down Move Right Move Right Move Right Move Down Move Right Move Right Move Right Move Right Move Down Move Down Move Down Move Down Move Down Move Right
Write a program that simulates a robot running a queue of commands to move around a board with obstacles. The board is composed of spaces that are either empty (_ "or have an obstacle "X"). Also the board is assumed to be 10x10 spaces. The robot ("O") has an x and y position corresponding to its location on the board, and four commands: move up, move down, move left, and move right. Both the board and the robot's commands are assumed to be read in via a file (you can make your own format). Assume the robot starts in the top left corner of the board. The robot and an obstacle cannot exist in the same space, and if that happens the robot will "crash, or in other words the simulation will stop. Also if the robot goes outside of the bounds of the board then the robot will "crash" as well. The robot's commands must be enqueued and dequeued from a Generic Queue of your own making. You may not use the built in Java Queue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

Identify the ways in which the president plays a role in lawmaking.

Answered: 1 week ago