Create an n by m array

Assignment Help Basic Computer Science
Reference no: EM13165712

Create an n by m array (n, m input by user). Initialize all cells in array to 0. The bug starts at cell 1,1. The bug can jump from its cell to any neighboring cell (left, right, up, down, diagonal) -- so there are at most 8 neighboring cells. Though, for example, cell 1, 1, has only 3 neighboring cells, If the bug tries to jump of of the array, ignore that move. A move is determined by generating a random number between 1 and 8.

1 -- jump left
2 -- jump right
3 -- jump up
4 -- jump down
5 -- jump up and right
6 -- jump up and left
7 -- jump down and right
8 -- jump down and left

Count how many moves it takes until the bug has visited each cell at least once. Display the array after each move, with a count for each cell of how many times the bug has visited that cell as well as what is the bug's current location.

Reference no: EM13165712

Questions Cloud

A[0..n-1] and b[0...n-1] are sorted arrays : A[0..n-1] and B[0...n-1] are sorted arrays where each contains n numbers. Design an O(n*log(n)) algorithm to find the median of all elements in arrays X and Y.
Evaluate the molarity of the hcl solution : How many mmoles of HCl reacted with the Na2CO3? c. Calculate the molarity of the HCl solution.
State what is the order of the reaction with respect to h2o2 : If a second experiment is done with half as much H2O2 as the experiment in question 1, and the solution turns blue in 180 seconds, what is the order of the reaction with respect to H2O2?
State potassium iodide required sodium thiosulfate titrant : In an acidic solution (with an excess of iodate), the titration of a 25 mL sample of potassium iodide required 26.51 mL of 0.0949M sodium thiosulfate titrant.
Create an n by m array : Create an n by m array (n, m input by user). Initialize all cells in array to 0. The bug starts at cell 1,1. The bug can jump from its cell to any neighboring cell (left, right, up, down, diagonal) -- so there are at most 8 neighboring cells. Thou..
Disubstituted alkene was formed in which the olefinic proton : disubstituted alkene was formed in which the olefinic protons exhibited a vicinal coupling of 9.0Hz in the H NMR. What is the stereochemistry
Marie program that will input a variable : To develop a MARIE program that will input a variable number of user entered Decimal whole number grades, validating each one (0-100) in a subroutine
Write a function that computes length of a character string : Write a function that computes the length of a character string (i.e. write your own implementation of the strlen function.
State hydrangeas are flowers that retain blue coloration : Hydrangeas are flowers that retain blue coloration when grown in acidic soil and pink when grown in neutral or alkaline soil

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explaining significance of automating boundary

In System Analysis and Design: Automation Boundary - Why is the automating boundary significant?

  Find speedup gain of using simd computer over sisd computer

If both SISD and SIMD machines run at same clock speed, determine the speedup gain of using the SIMD computer over the SISD computer?

  Explaining set of all regular languages is countable

Prove or disprove: the set of all regular languages is countable.

  The radar gun used by a police officer

The radar gun used by a police officer outputs a radar signal and measures the speed of the cars as they pass. However, when the officer wants to ticket an individual for speeding

  Explaining topic important for network administrators

Why is the topic important for network administrators today?

  Organizing function of management

Discuss and explain the company function of management as it relates to at least two of the organizational resources:

  Relative risk comes form inside the organisation

Write a report on relative risk that comes form inside organisation as opposed to risk which comes from external sources.

  What are different types of memory

What are some of the newer technology innovations you have seen in regards to I/O and Memory? What are the different types of Memory and how much is recommended?

  How pms allot preservation treatment to candidate project

1. Does PMS allot preservation treatment to candidate project? 2. If answer to question 1 is Yes or Under Development, which groups of treatments does PMS cover?

  How to convert a string of binary into decimal

how to convert a string of binary into decimal and a decimal into binary using java

  Explaining real-world group support system success stories

Identify one real-world Group Support System success stories (e.g., from vendor Web sites or from reports/articles) and describe them.

  Create a program that reads number of dooflingies

The shipping clerk at Rinky Dooflingy Corporation is faced with the problem: Dooflingies are very deilicate and must be shipped in special containers.

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