Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Munching-squares/Prolog/munching-squares.pro
Normal file
18
Task/Munching-squares/Prolog/munching-squares.pro
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
xor_pattern :-
|
||||
new(D, window('XOR Pattern')),
|
||||
send(D, size, size(512,512)),
|
||||
new(Img, image(@nil, width := 512, height := 512 , kind := pixmap)),
|
||||
|
||||
forall(between(0,511, I),
|
||||
( forall(between(0,511, J),
|
||||
( V is I xor J,
|
||||
R is (V * 1024) mod 65536,
|
||||
G is (65536 - V * 1024) mod 65536,
|
||||
( V mod 2 =:= 0
|
||||
-> B is (V * 4096) mod 65536
|
||||
; B is (65536 - (V * 4096)) mod 65536),
|
||||
send(Img, pixel(I, J, colour(@default, R, G, B))))))),
|
||||
|
||||
new(Bmp, bitmap(Img)),
|
||||
send(D, display, Bmp, point(0,0)),
|
||||
send(D, open).
|
||||
Loading…
Add table
Add a link
Reference in a new issue