Toy Basic Coordinates Sample Program

' This program draws a coordinates grid
' It might be helpful to understand Toy Basic coordinates

program "Coordinates"

xStep = 100
yStep = 100

width = GetMaxWidth()
height = GetMaxHeight()

for x=0 to width step xStep
	DrawLine(x, 0, x, height)
next

for y=0 to height step yStep
	DrawLine(0, y, width, y)
next

for x=0 to width step xStep
	for y=0 to height step yStep
		DrawText (x, y, x & ", " & y)
	next
next