paper(0)
Number Mod X Y
{
Value (X-(Y*(X/Y)))
}
Set RSEED 97
Number Random
{
Set BB 198621
Set MM (98921+)
Set BL (RSEED*BB+1)
Set RSEED
Value
}
Set RSEED (*)
Paper 0
command randomize row columns
//create an array of random 100's and 0's for each row
{
Repeat count 1 columns
{
Set r
//r spits out 0 or 1 randomly
Set selector (count+columns*row)
set (r*100)
}
}
command initialize rows columns
{
Repeat y 0 rows
{
randomize y columns
}
}
command fill start finish rows columns screenwidth speed
{
set countarray (columns*(rows+1))
repeat down (start/speed) (finish/speed)
{
repeat selector countarray 1
{
set [(selector%columns) (selector/columns)]
}
repeat selector 1 countarray
{
set
}
repeat i (down*speed-(speed/2)+1) (down*speed+(speed/2))
{
line (columns+1) i screenwidth i
}
}
}
command right rows columns screenwidth
{
set countarray (columns*(rows+1))
repeat t (-screenwidth) screenwidth
{
pen 0
line (columns+1) (rows/2+1 - t/10) ((screenwidth-columns-1)/2+columns+1) (rows/2+1)
pen 100
line screenwidth (rows/2+t/10) ((screenwidth-columns-1)/2+columns+1) (rows/2)
}
}
command left rows columns screenwidth
{
set countarray (columns*(rows+1))
repeat t (-screenwidth) screenwidth
{
pen 100
line (columns+1) (rows/2+t/10) ((screenwidth-columns-1)/2+columns+1) (rows/2)
pen 0
line screenwidth (rows/2+1 - t/10) ((screenwidth-columns-1)/2+columns+1) (rows/2+1)
}
}
command leftnull rows columns screenwidth
{
repeat t (-100) 0
{
pen 0
line (columns+1) (rows/2+1 - t/10) ((screenwidth-columns-1)/2+columns+1) (rows/2+1)
pen 100
line screenwidth (rows/2+t/10) ((screenwidth-columns-1)/2+columns+1) (rows/2)
}
}
command drain start finish
{
pen 0
repeat down start finish
{
line 10 down 100 down
}
}
command loop rows columns screenwidth speed
{
fill 0 (rows/2) rows columns screenwidth speed
right rows columns screenwidth
left rows columns screenwidth
right rows columns screenwidth
left rows columns screenwidth
right rows columns screenwidth
left rows columns screenwidth
leftnull rows columns screenwidth
fill (rows/2) rows rows columns screenwidth speed
drain rows 0
}
set rows 100
set columns 9
//maximum columns is floor of 1000/(rows+1)
set screenwidth 100
set speed 1
//speed should be 1, 2, 4, 6
//ACTION!
initialize rows columns
loop rows columns screenwidth speed
Create a general method for abstractly filling the DBN paper area at variable percentages. In a display loop, show the 25 percent, 50 percent, and 75 percent solutions in rotation.