Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
constant dimx = 512, dimy = 512
|
||||
constant fn = open("first.ppm","wb") -- b - binary mode
|
||||
sequence color
|
||||
printf(fn, "P6\n%d %d\n255\n", {dimx,dimy})
|
||||
for y=0 to dimy-1 do
|
||||
for x=0 to dimx-1 do
|
||||
color = {remainder(x,256), -- red
|
||||
remainder(y,256), -- green
|
||||
remainder(x*y,256)} -- blue
|
||||
puts(fn,color)
|
||||
end for
|
||||
end for
|
||||
close(fn)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
procedure write_ppm(sequence filename, sequence image)
|
||||
integer fn,dimx,dimy
|
||||
sequence colour_triple
|
||||
fn = open(filename,"wb")
|
||||
dimx = length(image)
|
||||
dimy = length(image[1])
|
||||
printf(fn, "P6\n%d %d\n255\n", {dimx,dimy})
|
||||
for y = 1 to dimy do
|
||||
for x = 1 to dimx do
|
||||
colour_triple = sq_div(sq_and_bits(image[x][y], {#FF0000,#FF00,#FF}),
|
||||
{#010000,#0100,#01})
|
||||
puts(fn, colour_triple)
|
||||
end for
|
||||
end for
|
||||
close(fn)
|
||||
end procedure
|
||||
Loading…
Add table
Add a link
Reference in a new issue