Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Ant Imagine a chess board and an ant. The ant is randomly put on the board and after that it can walk up, down,
The Ant Imagine a chess board and an ant. The ant is randomly put on the board and after that it can walk up, down, left and right (not diagonally). The ant cannot walk over the edge of the chess board (if it tries, it is not counted as a movement -- see it as a wall around the chess board). The task is to create a program called Ants.java that simulates the walking over the chess board of an ant. To walk to another square than the one the ant is currently on is called a "step" (even though it will take the ant several steps to move...). Each simulation should calculate the number of "steps" the ant takes to visit all squares on the chess board. The simulations must be done ten times and an average should be calculated at the end of the simulation. An example run of the simulation is shown below: Ants Number of steps in simulation 1: 708 Number of steps in simulation 2: 818 Number of steps in simulation 3: 953 Number of steps in simulation 4: 523 Number of steps in simulation 5: 671 Number of steps in simulation 6: 338 Number of steps in simulation 7: 535 of steps in simulation 8: 702 Number of steps in simulation 9: 548 Number of steps in simulation 10: 418 Average amount of steps: 621.4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started