Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Munching-squares/Nim/munching-squares.nim
Normal file
18
Task/Munching-squares/Nim/munching-squares.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import random
|
||||
import imageman
|
||||
|
||||
randomize()
|
||||
|
||||
# Build a color table.
|
||||
var colors: array[256, ColorRGBU]
|
||||
for color in colors.mitems:
|
||||
color = ColorRGBU [byte rand(255), byte rand(255), byte rand(255)]
|
||||
|
||||
|
||||
var image = initImage[ColorRGBU](256, 256)
|
||||
|
||||
for i in 0..255:
|
||||
for j in 0..255:
|
||||
image[i, j] = colors[i xor j]
|
||||
|
||||
image.savePNG("munching_squares.png")
|
||||
Loading…
Add table
Add a link
Reference in a new issue