https://github.com/madd88/snakes-and-ladders
CLI PHP Game
https://github.com/madd88/snakes-and-ladders
Last synced: 16 days ago
JSON representation
CLI PHP Game
- Host: GitHub
- URL: https://github.com/madd88/snakes-and-ladders
- Owner: madd88
- Created: 2019-02-15T12:10:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-15T00:34:28.000Z (about 5 years ago)
- Last Synced: 2025-02-16T20:14:53.298Z (3 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# snakes-and-ladder
Create a CLI tool that plays a multiplayer game of snakes and ladders on it’s own, use PHP 7+. Using modern technics & tools of code organisation, correctness check, and delivery would be appreciated.
Rules:
- You must continue to roll the dice every second till you reach position 100 exactly, you start at position 1
- If your new position after the roll divides by 9 (9, 18, 27, 36…) you landed on a snake and must move back 3 places
- If your new position after the roll is 25 or 55 you must move forward 10 places
- If your roll is near the end of the game and you do not roll enough to move exactly to 100, you do not move forwardYou must output on a new line each turns dice roll, if they landed on a snake or ladder and where their final position was
There must be a hyphen to separate the dice roll from the position and snake/ladder verdict