Questionprogram use a matrix represents an island

Assignment Help Computer Engineering
Reference no: EM13348949

Question

Program Use a matrix represents an island surrounded by water. Two bridges lead out of island. A mouse is placed on the black square. Write down a program to make the mouse take a walk across the island. The mouse is authorized to travel one square at a time, either horizontally or vertically. A random number from 1 through 4 should be used to decide that direction the mouse is to take. The mouse drowns while he hits the water; he escapes when he enters a bridge. You could 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 mouse in a reinitialized array and go back and repeat the whole process. Calculate the number of times he escapes, drowns, and starves.

Input File

1. First input line - size of the array, include border of water and bridges

Next N input lines- rows of the two-dimensional array, where positions containing negative numbers represent the water, the position in the edge containing a 0 represent bridges, the position contain a 1 represents 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 mouse's starting position and position of the two bridges

3. A map showing frequency of the mouse's visits to each position

Reference no: EM13348949

Questions Cloud

Questionwrite a short program of five to ten lines in : questionwrite a short program of five to ten lines in assembly language to accomplish something. your program should
Questionwrite down an interactive program that prompts user : questionwrite down an interactive program that prompts user for three real numbers and finds the sum average smallest
Question 1help wantedin the early october gaetan ah kong : question 1help wantedin the early october gaetan ah kong the owner of chez gaetan catering company came into the
Questionusing matlabdescribes a function named insidecircle : questionusing matlabdescribes a function named insidecircle that takes 3 arguments as input- the center of the circle
Questionprogram use a matrix represents an island : questionprogram use a matrix represents an island surrounded by water. two bridges lead out of island. a mouse is
Question 1in planning amp designing facilities for the : question 1in planning amp designing facilities for the hospitality industry it is necessary to optimize scarce
Question 1discuss the importance of the food amp beverages : question 1discuss the importance of the food amp beverages department in the management structure of a hotel.question
Question 1a using the help of a diagram describe the layer : question 1a using the help of a diagram describe the layer of the .net framework that sits between visual basic.net
Question 1 discuss the main hrm challenges facing public : question 1 discuss the main hrm challenges facing public leadersquestion 2describe the common reform trends in hrm in

Reviews

Write a Review

Computer Engineering Questions & Answers

  Make a `show me'' button that displays the number

Write down a GUI program that is a game to be played by the user. A new employee is working on a classified mission and the program will randomly pick an expected profit to be guessed by the user. The program must randomly select a number within r..

  Cfl pumping lemma

Utilize the CFL pumping Lemma in order to show each of these languages not to be context-free.

  Locate the position of string in the str1 variable

Given the following string variable, write a statement that would locate the position of "string" in the str1 variable and store the result in an int variable named pos.

  Explain electrical and computer engineering

Electrical and Computer Engineering, Suppose Xt is a random process which is second-order stationary. Show that it is also stationary of order 1.

  Organizational information systems to a company plan

How are organizational information systems related to a company strategy? How does plan affect the information systems a company develops and uses.

  Define the process of database normalization

Explain the method of database normalization. Why does it occur and how is data "cleaned up" as it moves through forms 1NF, 2NF, and 3NF? When would data need to be placed in 4NF or BCNF?

  Write a function playexpert

Write a function playExpert(marbles) that given a number of marbles returns the number of marbles that the computer will take following the expert mode rules.

  Deducing an expression for pp

Utilizing the information above, deduce an expression for the PP, and provide comment on resulting expression. Also, what the ATM services would you utilize in order to obtain the best possible performance?

  Questionthink following relational schema for a

questionthink following relational schema for a

  Use a one-dimensional array to solve

make Use of a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each of which is between 10 and 100, inclusive.

  Factors affecting the group process and outcome

In class, we introduced different factors which may affect group process and outcome, like group size and the status effect.

  Which is the best option in your opinion

Conceivably, there are three choices for a front-end application to your SQL Server database solution. This includes a compiled binary executable that is stored on client computer, a web-based user interface, or a Microsoft Access project. Given t..

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