The Die Rolling Monk:

 

You have an imaginary triangle with three vertices.  Each vertex is given two unique numbers from the choice of 1-6 (which represents the numbers on a die).  Say that v1,v2,and v3 are your vertices.  An example of the vertex to die mapping might be v1 maps 1 & 2 , v2 maps 3 & 4, v3 maps 5 & 6.

 

Your job is to draw points in this imaginary triangle by using the following calculation:

 

When the die is rolled, a number between 1-6 is given.  The number will map to one of the three vertices.  A new point is created at the midpoint between the old location and the chosen vertex.

 

 

 

For example, say that v1,v2,v3 are your vertices of an equilateral

triangle pointing up.  Let v1 be at (0,0), v2 at (5,10), v3 at (10,0).

 

  /\v2

 /  \

/____\

v1    v3

 

Say you start at v1.  The die is rolled and you get the value 5 (which

maps to v3.  So the new point will be between v1 and v3 which would be

(5,0).  You will then draw this new point.  If the die is rolled again and gets the value of 5 again, then the new point will be between (5,0) and v3.  Which will be (7.5, 0).

 

The abstract procedure of this program is this:

1) Monk roles the die (generates a number from 1-6)

2) Based on the value of the die you will calculate a new location on your imaginary triangle

3) You draw in OpenGL a point at the new location.

 

So what happens when this procedure is executed many, many times?  Would your imaginary triangle simply fill up with dots?  Or does a pattern appear?  Try it out and around 10,000 die rolls you’ll get your answer.