akosiraff

Download Stumble

Nov 13th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/stumble/
  3. Simulate the walk of a drunkard in a square street grid. Assume a grid of 10 streets horizontally and 10 streets vertically. Simulate a drunken person moving starting at the center of the grid. Simulate for 100 times the person picking a direction (east, west, north and south), move one block in the chosen direction. After 100 simulation print the location as a horizontal (east/west) and vertical (north/south) from the center. Hint: declare two variables one to keep track of east/west movement and the other to track north/south. Add or subtract one from the corresponding variable depending on the moves.
  4. Download: http://solutionzip.com/downloads/stumble/
Add Comment
Please, Sign In to add comment