Vibrating rectangles: Difference between revisions

Vibrating rectangles in various BASIC dialents (BASIC256, FreeBASIC and True BASIC)
m (→‎{{header|Phix}}: syntax coloured, added online link)
(Vibrating rectangles in various BASIC dialents (BASIC256, FreeBASIC and True BASIC))
Line 119:
Return
;----------------------------------------------------------------</lang>
 
 
=={{header|BASIC}}==
==={{header|BASIC256}}===
<lang freebasic>ancho = 200 : alto = ancho
 
graphsize ancho, alto
clg
 
while not keypressed(16777216) #ESCape
color rgb(rand * 255, rand * 255, rand * 255), 0
for sz = 2 to ancho step 4
rect (sz, sz, ancho - sz*2, alto - sz*2)
pause 0.05
next sz
end while</lang>
 
==={{header|FreeBASIC}}===
<lang freebasic>Const ancho = 400, alto = ancho
Screenres ancho, alto, 16
Windowtitle "Rosetta Code Vibrating rectangles"
Cls
 
Do
Color Rgb(Rnd * 255, Rnd * 255, Rnd * 255)
For sz As Integer = 2 To ancho Step 4
Line (sz, sz) - (ancho - sz, alto - sz),, B
Sleep 40
Next sz
Loop Until Inkey = Chr(27) 'ESC</lang>
 
==={{header|True BASIC}}===
<lang QBasic>SET WINDOW -90, 90, -90, 90
 
DO
SET COLOR INT(RND * 15)
FOR i = 2 to 90 step 4
BOX LINES i, 45-i, i, 45-i
PAUSE .2
NEXT i
LOOP
END</lang>
 
 
=={{header|C}}==
2,169

edits