Write a 2D array of integers to represent a swamp. You will be given a swamp tha
ID: 3656388 • Letter: W
Question
Write a 2D array of integers to represent a swamp. You will be given a swamp that has already been dimensioned and initialized. Every value of 0 represents quicksand while every value of 1 represents solid ground. Your job will be to follow the trail of 1's (solid ground) to the edge of the swamp - or until it dead ends. You will take one step at a time in any direction as long as that step is onto solid ground ( 1 ), and not into quicksand ( 0 ). Put simply, you are dropped into the swamp onto a block of solid ground and starting there must follow the trail of safe steps one at a time until you either reach the edge of the swamp (rescued) or reach a dead end (stranded). You are guaranteed the following: There are no cycles in your path to freedom or dead end (thus no backtracking/recursion needed). You will start out on a block of solid ground. There is only one possible path to take, and thus only one possible correct output for any given swamp. be sure to include code for onEdge() and nextStep() Your output must match mineExplanation / Answer
plz chk this link, it will hope assist u. plz don't forget life saver if u satisfied.
http://www.cs.pitt.edu/~hoffmant/F12-007/program-09/index.html
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.