Questionwrite a program use a matrix represents an island

Assignment Help Computer Engineering
Reference no: EM13348598

Question

Write a Program Use a matrix represents an island surrounded by water. Two bridges lead out of the island. A mouse is positioned on the black square. Write down a program to make the mouse take a walk across the island. The mouse is allowed to travel one square at a time, either horizontally or vertically. A chance number from 1 through 4 have to be used to decide that direction the mouse is to take. The mouse drowns when he hits the water; he breaks out when he enters a bridge. You might generate a random number up to 100 times. If mouse does not find his way by the hundredth try, he will die of starvation. Restart the mouse in a reinitialized array and go back and repeat the whole process. Count up the number of times he escapes, drowns, and starves.

Input File-

1. First input line - size of array, as well as border of water and bridges

2.Next N input lines-the rows of the two-dimensional array, where the positions containing negative numbers represent the water, the positions in the edge containing a 0 represent the bridges, the position containing a 1 represents the starting position of the mouse, and all other positions contain 0s.

Output-

1. A line stating whether mouse escaped, drowned, or starved

2. A line show the mouse's starting position and the position of two bridges

3. A map show the frequency of the mouse's visits to each location

 

Reference no: EM13348598

Questions Cloud

Question 1a differentiate between a standard user and a : question 1a differentiate between a standard user and a root user in linuxb name any five duties of a system
Question 1a what is the main advantage of multiprogrammingb : question 1a what is the main advantage of multiprogramming?b how does the distinction between the monitor mode and user
Question 1a process is a program under execution and as it : question 1a process is a program under execution and as it executes it changes state. the state of a process is defined
Question 1a explain two reasons driving the creation of : question 1a explain two reasons driving the creation of processes.b suppose we want a system to have two ready states
Questionwrite a program use a matrix represents an island : questionwrite a program use a matrix represents an island surrounded by water. two bridges lead out of the island. a
Questionhow can government justify telling private industry : questionhow can government justify telling private industry how to set up or recover their cybersecurity?1. clearly
Questionwrite down a function that creates a cell array and : questionwrite down a function that creates a cell array and structure array and populate them with data about element
Questionon january 1 2012 john doeby enterprises acquired a : questionon january 1 2012 john doeby enterprises acquired a 55 interest in bmi inc. bmi. doeby paid for the transaction
Questionconsider a very simple symmetric block encryption : questionconsider a very simple symmetric block encryption algorithm in which 32-bits blocks of plaintext are encrypted

Reviews

Write a Review

Computer Engineering Questions & Answers

  Example of a business problem solved using a case statement

offer an example of a business problem solved using a case statement. Give an example for a business problem solved with an IF statement. Can IF statements replace SELECT statements, why or why not.

  What alternative approach would achieve a similar result

You do so and discover that the programs load much faster now. What happened? What alternative approach would achieve a similar result more easily?

  What is the network

explain the main types of networks.

  Create a function definition called addarray

Write down a function definition called addarray that takes two parameters- one an array as an int and the other an int that contains the number of elements of the array. The function would return the sum of the number of elements of the array as ..

  What is the expected access time

Given a 64-byte cache block, a 512 KB fully associative cache (assume byte-addressable), and a 32 bit address reference, which bits could be used for tag, index, and offset.

  Create a testrectangle class in java

An overloaded constructor that takes integer width and height arguments, uses a separate method to check whether the width and height fall within the range between 0 and 30, and throws an exception if out of range.

  Research for a voip solution

In the future, Klamath’s separate the voice network will be dismantled. All the voice, data, and video traffic will traverse Metro Ethernet network.

  Make use of a regularexpressionvalidator control

make Use of Visual Studio.NET 2005 to create an ASP.NET project with four aspx forms. Use Master Pages to display a company name selected by your group at the top each form.

  Organizational information processing theory

What is organizational information processing theory, explain its concepts and what do you meant by creating the slack resource, make the lateral relationship.

  What mean to take a systems view of a project

What does it mean to take a systems view of a project? How does taking the systems view of a project apply to project management.

  Find out the minimum-cost spanning trees

Find out the shortest paths from S to all the other nodes in the graph using Dijkstra Algorithm.

  Write down a simple near procedure

Write down a simple near procedure (such as a return) and call it using register addressing.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd