Write a program use a matrix represent

Assignment Help Computer Engineering
Reference no: EM132543

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: EM132543

Questions Cloud

Explain the client-server architecture : What are the three different categories of command, support your answer by giving three examples. Give three good reasons, with valid explanation, to justify why partitioning hard disk provides a variety of advantages. Explain the client/server..
What is the main advantage of multiprogramming : What is the main advantage of multiprogramming How does the distinction between the monitor mode and user mode function as a rudimentary form of protection (security) system What is the difference between a trap and an interrupt? What is the u..
Explain deadlock-avoidance system : What is the difference between a safe state and an unsafe state in a deadlock-avoidance system?
Explain the concepts of consumable and reusable resources : Explain the concepts of consumable and reusable resources
Write a program use a matrix represent : Write a Program Use a matrix represent.
How to set up or recover cybersecurity : How to set up or recover cybersecurity.
Write a function that creates a cell and structure array : Write a function that creates a cell and structure array.
Prepare the entry doeby will record to reflect acquisition : Prepare the entry Doeby will record to reflect this additional acquisition.
Illustrate decryption equation : Illustrate decryption equation.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down an assembly language program

Write down an assembly language program The product number from one to five (3 characters wide, right justified)

  How to produce a wired and wireless network plan

How to produce a wired and wireless network plan

  How to produce a work breakdown structure

How to produce a Work Breakdown Structure. Ensure main WBS tasks headings are the 5 PMBOK® process areas.

  Design a data structure which supports two operations

Design a data structure which supports two operations 1. Insert(S, x) inserts x into S. 2. Remove-Duplicates(S) removes from S all duplicated values.

  Examine the importance and purpose of of n-tier systems

Examine the importance and purpose of of n-tier systems

  How to concern about personal privacy, efficiency

How to concern about personal privacy, efficiency

  Is it right that rbac functionality is complicated

Is it right that RBAC functionality is complicated

  How to write basic structure of an exception handler

How to write basic structure of an Exception handler a. generate an abstract class Furniture b. Declare an abstract process Discount the returns no value but accepts the cost of item

  Java program that asks the user to enter two numbers x and b

Java program that asks the user to enter two numbers x and b.

  What are prospect trends for healthcare informatics

What are prospect trends for healthcare informatics.

  Encipher a message using a keyword

The first program will encipher a message using a keyword and second program will decipher a message using a keyword.

  Write program that generates casual number between 1 and 100

Write program that generates casual number between 1 and 100?

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