setscreen ("graphics:400, 400")
var fontNumbers := Font.New ("Courier New:10")
procedure DrawTheCell (x, y, w, h : int)
var clr : int := 255
if (x + y) mod 2 = 0 then
clr := 0
end if
drawfillbox (x * w, (y + 1) * h, (x + 1) * w, (y) * h, clr)
end DrawTheCell
var w : int := 40
var h : int := 40
drawfillbox (0, 0, maxx, maxy, 50)
var letters : array 1 .. 8 of string
letters (1) := "a"
letters (2) := "b"
letters (3) := "c"
letters (4) := "d"
letters (5) := "e"
letters (6) := "f"
letters (7) := "g"
letters (8) := "h"
for i : 1 .. 8
locatexy (i * w + w div 2, h div 2)
colorback (50)
put letters (i)
end for
for j : 1 .. 8
colorback (50)
Font.Draw (intstr (j), w div 2, j * h + h div 2, fontNumbers, 255)
end for
for i : 1 .. 8
for decreasing j : 8 .. 1
DrawTheCell (i, j, w, h)
end for
end for
var xaxis := w + w div 6
var yaxis := h + (h div 6)
var piece : int := Pic.FileNew ("images/Rw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Nw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Bw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Qw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Kw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Bw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Nw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Rw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := w + w div 6
yaxis := h * 8 + (h div 6)
piece := Pic.FileNew ("images/Rw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Nw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Bw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Qw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Kw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Bw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Nw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
xaxis := xaxis + w
piece := Pic.FileNew ("images/Rw.JPG")
Pic.SetTransparentColor(piece, white)
Pic.Draw (piece, xaxis, yaxis, picMerge)
piece := Pic.FileNew ("images/Pw.JPG")
Pic.SetTransparentColor(piece, white)
for i : 1 .. 8
xaxis := i * w + w div 6
yaxis := h + h + (h div 6)
Pic.Draw (piece, xaxis, yaxis, picMerge)
end for
piece := Pic.FileNew ("images/Pb.JPG")
Pic.SetTransparentColor(piece, white)
for i : 1 .. 8
xaxis := i * w + w div 6
yaxis := h * 7 + (h div 6)
Pic.Draw (piece, xaxis, yaxis, picMerge)
end for
var x, y, button : int
loop
mousewhere (x, y, button)
locate (1, 1)
if x > 40 and y > 40 and x < 9 * h and y < 9 * w then
put "The mouse is in cell ", y div w, " , ", letters (x div w )
else
put "mouse is out of screen"
end if
end loop
|