Последняя активность 1730513051

Версия 379d2c40c8c75a0d2ac7c0eda134984dd7113761

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|--| Copy temporaries back to their respective variables.
22|*x|x|*y|y
23
24|plot_pixel| pixel_x, pixel_y, pixel_red, pixel_green, pixel_blue, set pixel
25| pixel_x | pixel_x=x:399
26| pixel_y | pixel_y=y:399
27| pixel_red | pixel_red=x:399
28| pixel_green | pixel_green=y:399
29| pixel_blue | pixel_blue=x+y:399
30| set pixel | @set-pixel
31
32|--| Move the `x/y` coordinates.
33|x-,x||x-||y-,y||y-|
34
35|--| Main loop.
36||x:399,y:399
37|draw, end of line,x|draw, end of line,draw
38|draw, end of line|draw, end of screen?, @display
39|draw,~ end of line|plot_pixel,x-,draw
40|draw, end of screen|plot_pixel,x:399,y:399
41|draw,~ end of screen,x|draw,~ end of screen
42|draw,~ end of screen|y-,x:399,draw
43|draw| end of line?,draw
44
45|--| clean up remaining facts
46|x||y|
47
48||draw
49