RosettaCodeData/Task/Greyscale-bars-Display/Yabasic/greyscale-bars-display.basic
2023-07-01 13:44:08 -04:00

23 lines
482 B
Text

open window 1024, 600
w = peek("winwidth")
h = peek("winheight")
rows = 4
hd = int(h / rows)
mitad = 0
for row = 1 to rows
if not mitad then
wd = int(w / (8 * row))
mitad = wd
else
mitad = mitad / 2
end if
c = 255 / (w / mitad)
for n = 0 to (w / mitad)
color 255 - c * n, 255 - c * n, 255 - c * n
if mod(row, 2) = 0 color c * n, c * n, c * n
fill rectangle mitad * n, hd * (row - 1), mitad * (n+1), hd * row
pause .1
next n
next row