Snakes and Ladders
Must have: MATLAB program, Snakes and Ladders code, and simple game engine.
Download the Snakes and ladders code online, drag it to the MATLAB folder in the file explorer on your computer.
Open MATLAB, in the box labeled “Current Folder”, double-click on the icon that says something similar to Snakes_and_Ladders.m
The script editor should be open, on the “Editor” tab, in the “Run” section, press “Run”.
There are words in the code that look similar but mean different things to the players:
roll= The roll of one dice
rollTotal= The total of the two rolls done in that round
rollTurn= The total space the player is in at the end of the round
lastTurn= The space of the last turn the player took
snakeSpace= a space where a snake is, roll to that spot and you go down some spaces
ladderSpace= a space where a ladder is, roll to that spot and you go up some spaces
This is a two player game. Grab a partner! When you’re starting the game, press 0.
Make sure to keep track of the number of the space you’re in and enter the roll turn from the last round when your turn pops up.
Good luck and have fun!