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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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