Question
You have been asked to create a board game simulator that is fully automated. The game consists of 2 players; i) A Runner and ii)
You have been asked to create a board game simulator that is fully automated. The game consists of 2 players; i) A Runner and ii) a Chaser and the rules are as follows; 1. The board has a total of 100 squares laid out as 10 squares wide and 10 squares high. You should make the (0,0) square be the top-left square and (9, 9) the bottom right square. 2. The Runner starts at position (9, 9) which is the bottom right hand corner of the board. 3. If the Runner makes it to any square on the top row (x, 0), the Runner wins. 4. The Chaser starts at position (0, 9) - the left hand corner of the board. 5. If the Chaser lands on the same square as the Runner before the Runner makes it to the top, the Chaser wins. 6. Each move should be a minimum of 1 square and a maximum of either 3 or 4 squares (if the game completes too quickly or slowly you might want to vary this value). 7. A player can only move in a straight line for each move, say, north, east, west or south (hint: kind of sounds like an enum based data type). 8. Both players must stay within the bounds of the board at all times. For example, if a player is 2 squares from the east wall and they roll a 3 in the east direction then they only move 2 squares and and stop at the east wall. 9. If neither player has achieved their goal after 100 total turns - 50 per player - the program should end in a stalemate. In order to move the characters you can roll virtual dice to generate both the number of squares and the direction of the move. In Swift, the typical way to do this is by using; n Copyright 2020 6 CA-IOSWT v1-0 Assign. 2 2020-0309 New game started ... Chaser [0, 9] Runner [9, 9] TURN -> Runner ... rolling ... 'Runner' has moved North 2 to [9, 7] Countdown: 100 TURN -> Chaser ... rolling ... 'Chaser' has moved East 1 to [1, 9] Countdown: 99 TURN -> Runner ... rolling ... 'Runner' has moved West 1 to [8, 7] Countdown: 98 TURN -> Chaser ... rolling ... 'Chaser' has moved North 1 to [1, 8] Countdown: 97 TURN -> Runner ... rolling ... 'Runner' has moved North 3 to [8, 4] Countdown: 96 TURN -> Chaser ... rollin
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