Остання активність 1730513051

Версія 97d2a6247049287154c24682f045dc3133576c58

rgb400_ungolfed Неформатований Playground
1|--| Are we at the end of a line?
2| end of line?,x|x,~ end of line| end of line?| end of line
3
4|--| Are we at the end of the screen?
5| end of screen?,y|y,~ end of screen| end of screen?| end of screen
6
7|--| Co pixel_y the pixel coordinates from `x/y` to `@pixel-x/@pixel-y`.
8| pixel_x=x,x|*x,@pixel-x, pixel_x=x
9| pixel_x=x|
10| pixel_y=y,y|*y,@pixel-y, pixel_y=y
11| pixel_y=y|
12
13|--| Compute some pixel colors based on the `x/y` coordinates.
14|--| r = x, g = y, b = x + y
15| pixel_red=x,x|*x,@pixel-r, pixel_red=x| pixel_red=x|
16| pixel_green=y,y|*y,@pixel-g, pixel_green=y| pixel_green=y|
17| pixel_blue=x+y,x|*x,@pixel-b, pixel_blue=x+y
18| pixel_blue=x+y,y|*y,@pixel-b, pixel_blue=x+y
19| pixel_blue=x+y|
20
21|--| Co pixel_y temporaries back to their respective variables.
22|*x|x|*y|y
23
24|--| Plot a pixel.
25|plot_pixel| pixel_x, pixel_y, pixel_red, pixel_green, pixel_blue,ps
26| pixel_x| pixel_x=x:399
27| pixel_y| pixel_y=y:399
28| pixel_red| pixel_red=x:399
29| pixel_green| pixel_green=y:399
30| pixel_blue| pixel_blue=x+y:399
31|ps|@set-pixel
32
33|--| Move the `x/y` coordinates.
34|x-,x||x-||y-,y||y-|
35
36|--| Main loop.
37||x:399,y:399
38|draw, end of line,x|draw, end of line,draw
39|draw, end of line|draw, end of screen?, @display
40|draw,~ end of line|plot_pixel,x-,draw
41|draw, end of screen|plot_pixel,x:399,y:399
42|draw,~ end of screen,x|draw,~ end of screen
43|draw,~ end of screen|y-,x:399,draw
44|draw| end of line?,draw
45
46|x||y|
47
48||draw
49