Part of the Samples Website. 8/16/97.

samples.basicStuff.randomBarChart

«this script uses BarChart to measure the randomness of Frontier's random number generator
app.start ("BarChart")
local (ctbars = 7)
local (windowtitle = "Random Number Test Window")
bundle «establish contact, open a window, label the bars
if app.selectWindow (windowtitle) «already has a window with this title
BarChart.setBarCount (ctbars)
else
BarChart.newWindow (ctbars, windowtitle, "")
BarChart.setBar (1, "Mon", 0)
BarChart.setBar (2, "Tue", 0)
BarChart.setBar (3, "Wed", 0)
BarChart.setBar (4, "Thu", 0)
BarChart.setBar (5, "Fri", 0)
BarChart.setBar (6, "Sat", 0)
BarChart.setBar (7, Sun, 0)
loop «pick a bar, add one to it; press cmd-period to kill the script
local (x = random (1, 7))
BarChart.setBarValue (x, BarChart.getBarValue (x) + 1)


This page was last built on Sat, Aug 16, 1997 at 6:39:12 PM. You can download the current set of sample scripts from our FTP site. Dave