Microsoft Small Basic
Program Listing: XTN217
List Program
s="Small basic is fun"
mx=200
my=200
maxzoom=5
'splits de tekst in losse woorden
'maak voor elk woord een shape
p=text.GetIndexOf(s, " ")
aantalwoorden=0
GraphicsWindow.Show()
While p>0
t=text.GetSubText(s,1,p-1)
s=text.GetSubText(s,p+1,text.GetLength(s)-p)
p=text.GetIndexOf(s, " ")
aantalwoorden=aantalwoorden+1
woord[aantalwoorden]=shapes.addtext(t)
dx=math.GetRandomNumber(15)-8
dy=math.GetRandomNumber(15)-8
Shapes.Move(woord[aantalwoorden],mx+dx,my+dy)
z=math.GetRandomNumber(maxzoom)
Shapes.Zoom(woord[aantalwoorden],z,z)
endwhile
aantalwoorden=aantalwoorden+1
woord[aantalwoorden]=shapes.addtext(s)
Shapes.Move(woord[aantalwoorden],mx+dx,my+dy)
z=math.GetRandomNumber(maxzoom)
Shapes.Zoom(woord[aantalwoorden],z,z)
'laat de woorden nu trillen
'GraphicsWindow.DrawBoundText(10,10,1000,aantalwoorden)
While "true"
c=40
For i=1 To aantalwoorden
dx=math.GetRandomNumber(2*c-1)-c
dy=math.GetRandomNumber(2*c-1)-c
Shapes.move(woord[i],mx+dx,my+dy)
Shapes.move(woord[i],mx+dx,my+dy)
endfor
Program.Delay(300)
endwhile