1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72:
| var i,x,y,modtemp: integer;
begin form1.Canvas.Pen.Color := clBlack; for i:=0 to 8 do begin canvas.MoveTo(60+i*50,60); canvas.LineTo(60+i*50,460); canvas.MoveTo(60,60+i*50); canvas.LineTo(460,60+i*50); end;
x := 0; while x <> 8 do begin x := x + 1; for y := 1 to 8 do begin modtemp := y mod 2; if modtemp = 0 then begin Form1.Canvas.Brush.Color := clWhite; Form1.Canvas.FillRect(Rect(50*(y)+11,50*(x)+11, 50*(y)+60,50*(x)+60)); end else begin Form1.Canvas.Brush.Color := clGray; Form1.Canvas.FillRect(Rect(50*(y)+11,50*(x)+11, 50*(y)+60,50*(x)+60)); end; end; end;
x := 0; while x <> 8 do begin x := x + 2; for y := 1 to 8 do begin modtemp := y mod 2; if modtemp = 0 then begin Form1.Canvas.Brush.Color := clGray; Form1.Canvas.FillRect(Rect(50*(y)+11,50*(x)+11, 50*(y)+60,50*(x)+60)); end else begin Form1.Canvas.Brush.Color := clWhite; Form1.Canvas.FillRect(Rect(50*(y)+11,50*(x)+11, 50*(y)+60,50*(x)+60)); end; end; end;
form1.Canvas.Brush.Color := clBtnFace;
font.Name:='Arial'; font.Size:=20;
for i:=1 to 8 do begin canvas.TextOut(i*50+25,20,chr(96+i)); canvas.TextOut(25,i*50+20,inttostr(i)); end;
end; |