EDIT: I forgot to mention that this does utilize MatrixUtils, although you can probably do without if you tweak it a bit.

What is CHOMP?

http://en.wikipedia.org/wiki/Chomp

It's a perfect information game that, unlike in Tic-Tac-Toe where a draw is inevitable, CHOMP always gives the victory to the first player, supposing you know what the optimum moves are.

This is something of an incomplete CHOMP simulator I designed after spending a brief few hours with the game. It was entertaining, and it taught me something about game design, so I recommend that if your inner child is alive and well, you read up on the wiki and get a friend to play you a few rounds. Or, if you'd like, build an AI and try to build a system that can beat you.

TYPE piece
is_taken AS BOOLEAN
is_highlighted AS BOOLEAN
ENDTYPE
#CONSTANT col_black RGB(0,0,0)
#CONSTANT col_lcyan RGB(224,255,255)
#CONSTANT col_red RGB(255,0,0)
#CONSTANT col_gray RGB(128,128,128)
#CONSTANT col_dimgray RGB(105,105,105)
SYNC ON
SYNC RATE 60
act_col AS DWORD
n=5
DIM board(n,n) AS piece
DO
CLS col_gray
//First-Clear Checks
FOR x=0 TO n
FOR y=0 TO n
IF KEYSTATE(19)=1 THEN board(x,y).is_taken=0
board(x,y).is_highlighted=0
NEXT y
NEXT x
//First- Check Sequence
FOR x=0 TO n
FOR y=0 TO n
IF button_mouseover(16+(20*x)-5,16+(20*y)-5,16+(20*x)+5,16+(20*y)+5)=1
FOR kx=x TO n
FOR ky=y TO n
board(kx,ky).is_highlighted=1
NEXT kx
NEXT ky
ENDIF
IF button_pressed(16+(20*x)-5,16+(20*y)-5,16+(20*x)+5,16+(20*y)+5)=1
FOR kx=x TO n
FOR ky=y TO n
board(kx,ky).is_taken=1
NEXT kx
NEXT ky
ENDIF
NEXT y
NEXT x
IF MOUSECLICK()=0 THEN hold=0
//Final Phase-Draw Squares
FOR x=0 TO n
FOR y=0 TO n
act_col=col_lcyan
IF board(x,y).is_highlighted=1 THEN act_col=col_red
IF board(x,y).is_taken=1 THEN act_col=col_dimgray
IF x=0 AND y=0 THEN act_col=col_black
CIRCLE 16+(20*x),16+(20*y),5
FILL 16+(20*x),16+(20*y),act_col
NEXT y
NEXT x
SYNC
LOOP
FUNCTION button_mouseover(x1,y1,x2,y2)
check AS BOOLEAN
IF x1<MOUSEX() AND x2>MOUSEX() AND y1<MOUSEY() AND y2>MOUSEY() THEN check=1 ELSE check=0
ENDFUNCTION check
FUNCTION button_pressed(x1,y1,x2,y2)
check AS BOOLEAN
IF button_mouseover(x1,y1,x2,y2)=1 AND MOUSECLICK()=1 THEN check=1 ELSE check=0
ENDFUNCTION check