Quote: "function drawGrid()
function printBoard()"
FUNCTION is used to declare a function, if you want to call the function just type the name and parameters in brackets.
BOX is a faster drawing command than LINE: since LINE has to be able to draw in any direction it requires more calculations. To use BOX to draw straight lines you will need to give the box at least one pixel width or it wont display, I've done this for you and stored the width in a variable incase you want to scale it with the rest of the board.
All the variables declared inside your function can be constants, they will not change while the program is running, so they don't have to be inside the function where they will be initialized over and over again each time the function is called.
#constant centerX (screen width() / 2)
#constant centerY (screen height() / 2)
#constant sliceY (screen height() / 5)
global squareX (centerX - sliceY)
global squareY (centerY - sliceY)
#constant lineWidth = 1
...
function drawGrid()
box centerX - sliceY * 1.5, centerY - sliceY / 2, centerX + sliceY * 1.5, centerY - sliceY / 2 + lineWidth
box centerX - sliceY * 1.5, centerY + sliceY / 2, centerX + sliceY * 1.5, centerY + sliceY / 2 + lineWidth
box centerX - sliceY / 2, centerY - sliceY * 1.5, centerX - sliceY / 2 + lineWidth, centerY + sliceY * 1.5
box centerX + sliceY / 2, centerY - sliceY * 1.5, centerX + sliceY / 2 + lineWidth, centerY + sliceY * 1.5
endfunction
Formerly OBese87.