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

  The acme corporation is looking to rapidly advance

This solution provides the learner with an understanding of how best to accomplish the task. This solution is comprised of over 2000 words of text with 4 references.

  Plan a java class named mypoint to represent a point

create the class, and also write a test program that creates two points (0, 0) and (10, 30.5) and displays the distance between them.

  Selecting the operating system

What operating system must the library consider for this facility? And also explain why?

  How to solve following problems on functions

How to solve following problems on functions

  Determining occurance as incident or disaster

Categorize the following occurrences as an incident or disaster. If an occurrence is a disaster, find whether or not business continuity plans would be called into play.

  Describe the arp process

What is a ARP Request and ARP Reply?What is the broadcast.

  Peer-to-peer networking

Explain the term peer-to-peer networking? Describe why is bit torrent regarded to be a more efficient protocol? In the bit torrent context, explain how seeders and the leechers work.

  Standardizing service nomenclature

Explain how should one go regarding standardizing service nomenclature, like the process service names and outcomes, in order to obtain a level of ease with implementing enterprise wide software?

  Program dealing with selection of five random cards

Generate a program which deals with the five random cards.

  The difference between animation and transition effects

When are they appropriate? When is it better not to use them? Can you give me an examples.

  Show a letter grade based upon the average

In this script, convert pseudocode that uses a decision structure into a shell script. The script then will accept three grades, calculate an average, and then display a letter grade based upon the average.You will need to use either the if statem..

  Questionyour manager wants to apply rbac functionality your

questionyour manager wants to apply rbac functionality. your shop uses a unix scheme. you do not include a system with

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