Own-Programming-Language-Tu.../examples/canvas/2.own

17 lines
251 B
Scala
Raw Normal View History

2023-09-09 15:52:32 +03:00
use std, canvas
2015-07-11 21:19:59 +03:00
w = 800 h = 600
window("canvas example 2", w, h);
color(#ffffff)
frect(0, 0, w, h)
step = rand(20)
color(#0000ff)
2016-02-14 21:24:06 +02:00
for y = 0, y < h, y += step {
2015-07-11 21:19:59 +03:00
line(0, y, w, y)
}
2016-02-14 21:24:06 +02:00
for x = 0, x < w, x += step {
2015-07-11 21:19:59 +03:00
line(x, 0, x, h)
}
repaint();