langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,25 @@
$ include "seed7_05.s7i";
include "draw.s7i";
include "color.s7i";
const proc: writePPM (in string: fileName, in PRIMITIVE_WINDOW: aWindow) is func
local
var file: ppmFile is STD_NULL;
var integer: x is 0;
var integer: y is 0;
var color: pixColor is black;
begin
ppmFile := open(fileName, "w");
if ppmFile <> STD_NULL then
writeln(ppmFile, "P6");
writeln(ppmFile, width(aWindow) <& " " <& height(aWindow));
writeln(ppmFile, "255");
for y range 0 to pred(height(aWindow)) do
for x range 0 to pred(width(aWindow)) do
pixColor := getPixelColor(aWindow, x, y);
write(ppmFile, str(chr(pixColor.red_part)) <& chr(pixColor.green_part) <& chr(pixColor.blue_part));
end for;
end for;
close(ppmFile);
end if;
end func;