Son aktivite 1730513051

Revizyon 2798fdb269ba26349bd1eb35dae31f26de9c7499

rgb400_ungolfed Ham Playground
1|--| Are we at the end of a line?
2|end of line?, x| x, ~end of line
3|end of line?| end of line
4
5|--| Are we at the end of the screen?
6|end of screen?, y| y, ~end of screen
7|end of screen?| end of screen
8
9|--| Copy the pixel coordinates from `x/y` to `@pixel-x/@pixel-y`.
10|pixel_x=x, x|*x, @pixel-x, pixel_x=x
11|pixel_x=x|
12|pixel_y=y, y|*y, @pixel-y, pixel_y=y
13|pixel_y=y|
14
15|--| Compute some pixel colors based on the `x/y` coordinates.
16|--| r = x, g = y, b = x + y
17|pixel_red=x, x| *x, @pixel-r, pixel_red=x
18|pixel_red=x|
19
20|pixel_green=y, y| *y, @pixel-g, pixel_green=y
21|pixel_green=y|
22
23|pixel_blue=x+y, x| *x, @pixel-b, pixel_blue=x+y
24|pixel_blue=x+y, y| *y, @pixel-b, pixel_blue=x+y
25|pixel_blue=x+y|
26
27|--| Copy temporaries back to their respective variables.
28|*x|x
29|*y|y
30
31|plot_pixel| pixel_x, pixel_y, pixel_red, pixel_green, pixel_blue, set pixel
32|pixel_x| pixel_x=x:399
33|pixel_y| pixel_y=y:399
34|pixel_red| pixel_red=x:399
35|pixel_green| pixel_green=y:399
36|pixel_blue| pixel_blue=x+y:399
37|set pixel| @set-pixel
38
39|--| Move the `x/y` coordinates.
40|x-,x||x-||y-,y||y-|
41
42|--| Main loop.
43|draw, end of line, x| draw, end of line, draw
44|draw, end of line| draw, end of screen?, @display
45|draw, ~end of line| plot_pixel, x-, draw
46|draw, end of screen| plot_pixel, x:399, y:399
47|draw, ~end of screen, x| draw, ~end of screen
48|draw, ~end of screen| y-,x:399, draw
49|draw| end of line?, draw
50
51|--| clean up remaining facts
52|x|
53|y|
54
55|--| run the program
56||x:399,y:399
57||draw
58