Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We have a snail race we will have to determine the winner ! - The number of snails is given in the variable numberSnails. -

We have a snail race we will have to determine the winner !
- The number of snails is given in the variable numberSnails.
- Each snail has a speed given in the variable speedSnail
- You have a map of the game with a height of mapHeight and a width of mapWidth.
On the map we have:
number that represents a snail from 1 to numberSnails
* which represents a place where the snail can go
# which represents the destination
Snails can go right, left, up, down. Snails cannot go diagonally.
The snail takes the path closest to it.Input
Line 1: An integer numberSnails for the number of snails.
Next numberSnails lines: An integer speedSnail for the speed of a snail.
Next line: An integer mapHeight which is the height of the map.
Next line: An integer mapWidth which is the width of the map.
Next mapHeight lines: A string ROW for one line of the map.
Output
A number that represents the winner of the race
Constraints
2<= numberSnails <=6
0<= speedSnail <=6
2<= mapHeight <=6
5<= mapWidth <=9
Answer must be in Java

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

What must a creditor do to become a secured party?

Answered: 1 week ago

Question

When should the last word in a title be capitalized?

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago

Question

Be familiar with the integrative servicescape model.

Answered: 1 week ago