
-----------------------------------
Schaef
Thu Dec 11, 2003 10:16 pm

Checkerboard program code needed
-----------------------------------
I need a code for a checker board that has sqaures that are 50 pixels by 50 pixels and has 8 rows and 8 colums

-----------------------------------
Homer_simpson
Thu Dec 11, 2003 10:37 pm


-----------------------------------
well basically u are going to need a 2d arrow like this: board_array : array 1..8,1..8 of blah

and  yer gonna draw yer board like this :

for i : 1 .. 8
    for j : 1 .. 8
        drawbox (i * 50, j * 50 - 1, i * 50 - 50, j * 50 - 50, black)
    end for
end for

and make up some rules for yer game and vohlaaaaaa!!!

-----------------------------------
vinkster
Fri Dec 12, 2003 12:00 am

a little code
-----------------------------------
this might help.........property of a checker


View.Set ("graphics:600;400,position:top;left,offscreenonly")
var x, y, x1, y1, btnNumber, btnUpDown, buttons : int
function roundto (roundnum, roundinput : int) : int
    result roundinput div roundnum * roundnum
end roundto
colourback (7)
cls
drawfillbox (0, 0, 100, 100, 4)
drawfillbox (0, 200, 100, 300, 4)
drawfillbox (0, 400, 100, 500, 4)
drawfillbox (100, 100, 200, 200, 4)
drawfillbox (300, 100, 400, 200, 4)
drawfillbox (100, 300, 200, 400, 4)
drawfillbox (200, 0, 300, 100, 4)
drawfillbox (400, 0, 500, 100, 4)
drawfillbox (300, 100, 400, 200, 4)
drawfillbox (300, 300, 400, 400, 4)
drawfillbox (200, 200, 300, 300, 4)
drawfillbox (400, 200, 500, 300, 4)
drawfillbox (500, 100, 600, 200, 4)
drawfillbox (500, 300, 600, 400, 4)
var pic : int
pic := Pic.New (0, 0, maxx, maxy)
Pic.Draw (pic, 0, 0, picCopy)
var z, w : int := 30
x := 50
y := 50
drawfilloval (x, y, z, w, 8)
loop
    Mouse.ButtonWait ("down", x1, y1, btnNumber, btnUpDown)
    if x >= x1 - 25 and x = y1 - 25 and y 