Day 4b – Dice Code

Here is the TS2068 BASIC code to handle the dice rolls per the explanation in the previous post :

The subroutine at 9905 dimensions the arrays for die X, Y, Z and loads with the values for each of the 6 faces, then subroutine at 100 randomly selects a face from each die and does the math to calculate the roll, returning in the variable ROLL.  Code shown below from ZX-Editor and run in the Eighty-One emulator.

DICECODE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s