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
38
Task/Bitmap/SequenceL/bitmap.sequencel
Normal file
38
Task/Bitmap/SequenceL/bitmap.sequencel
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
RGB ::= (R: int(0), G: int(0), B: int(0));
|
||||
|
||||
newBitmap: int * int -> RGB(2);
|
||||
newBitmap(width, height)[y, x] :=
|
||||
(R: 0, G: 0, B: 0)
|
||||
foreach y within 1 ... height,
|
||||
x within 1 ... width;
|
||||
|
||||
fill: RGB(2) * RGB -> RGB(2);
|
||||
fill(bitmap(2), color)[y, x] :=
|
||||
color
|
||||
foreach y within 1 ... size(bitmap),
|
||||
x within 1 ... size(bitmap[y]);
|
||||
|
||||
setColorAt: RGB(2) * int * int * RGB -> RGB(2);
|
||||
setColorAt(bitmap(2), x, y, color)[Y, X] :=
|
||||
color when Y = y and X = x
|
||||
else
|
||||
bitmap[Y, X];
|
||||
|
||||
getColorAt: RGB(2) * int * int -> RGB;
|
||||
getColorAt(bitmap(2), x, y) := bitmap[y, x];
|
||||
|
||||
lightGreen := (R: 51, G: 255, B: 51);
|
||||
lightRed := (R: 255, G: 51, B: 51);
|
||||
|
||||
main(args(2)) :=
|
||||
let
|
||||
width := 1920;
|
||||
height := 1200;
|
||||
|
||||
cleanImage := newBitmap(width, height);
|
||||
|
||||
filledGreen := fill(cleanImage, lightGreen);
|
||||
|
||||
redCenter := setColorAt(filledGreen, width / 2, height / 2, lightRed);
|
||||
in
|
||||
getColorAt(redCenter, width / 2, height / 2);
|
||||
Loading…
Add table
Add a link
Reference in a new issue