Links
Home
Resume
Research
Programs
Java
Links
Websites
Email Me
Valid HTML 4.01!
Serpinski Program
CLS
SCREEN 12

INPUT "enter the width", w
INPUT "enter the length", l                  'enter the screen dimensions
WINDOW SCREEN (0, 0)-(w, l)

DO
r = INT((3 - 1 + 1) * RND + 1)               'pick a random number 1-3
IF r = 1 THEN
i = 0
j = 0
ELSEIF r = 2 THEN
i = 0
j = l                                        'the three points on the triangle
ELSEIF r = 3 THEN
i = w
j = l
END IF
x = (x + i) / 2
y = (y + j) / 2                              'divide by half and plot
PSET (x, y), 255
LOOP

Home | Resume | Research | Programs | Java | Links | Websites | Email Me