CONVERTED GAME FROM FORTRAN TO ASSEMBLER
This was written in Fortran and therefore depends on runtime subroutines plus the input-output support of the DMS2 monitor software. In order to provide this in the bare metal demonstration monitor, I had to rewrite it in Assembler. It was generally straightforward.
THE GAME
This is a simplified version of craps which involves players rolling a pair of dice and betting. In this game, the player starts with a bet amount and then rolls their dice. If the player gets a total of two (snake eyes) or 12 (boxcars) they lose their bet. If they get a total of seven (natural) or eleven (yo) they win their bet. If any other value is rolled, then our player has set their 'point' and keeps rolling dice.
If our player rolls the same number as their first roll (the point), our player wins their bet. If the player rolls a 7, our player loses their bet. If the roll value is anything else, the player rolls again. This continues until we have a win or loss.
After each win or loss, the player has their balance updated. When the player reaches a loss of $5,000 dollars, the game is over. When the player reaches a positive balance of $5,000, the game is over. Each time the player chooses a bet, which must be 1 to 1000 dollars, the sequence above occurs. If the player enters a 0 as the bet, they choose to end the game.
No comments:
Post a Comment