numberCheckerboard.frink

View or download numberCheckerboard.frink in plain text format


g = new graphics

rows = 9
cols = 12

g.color[0,0,0]

freeCells = new array

for row = 0 to rows
   for col = 0 to cols
   {
      if (row + col) mod 2 == 0
         g.fillRectSize[col, row, 1, 1]
      else
         freeCells.push[[row,col]]
   }

num = 1
g.font["SansSerif", .75]
   
while (length[freeCells] > 0)
{
   [row, col] = freeCells.removeRandom[]
   g.text[num, col + 1/2, row + 1/2]
   num = num + 1
}

//g.show[]
//g.print[]


View or download numberCheckerboard.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17591 days, 17 hours, 44 minutes ago.