 # That is, it 'focuses' on winning subboards.
 ais["focused"] = {}
 ais["focused"].move = () ->
-	if subboard_next.length < 1
-		return [4,4]
-
-	subboard_index = subboard_next[-1..][0]
+	console.log("focused ai move")
+	if subboard_next.length >= 1
+		subboard_index = subboard_next[-1..][0]
+	else
+		subboard_index = 4
+	
 	subboard = boards[subboard_index]
 	v = 2 * turn # number for matching one left
 	wins = []

# The random ai simply makes a random move on the currently active subboard.
ais["random"] = {}
ais["random"].move = () ->
	if subboard_next.length >= 1
		subboard = subboard_next[-1..][0]
		options = ais.unfilled_squares(subboard)

# The greedy ai picks the first open square on the currently active subboard.
ais["greedy"] = {}
ais["greedy"].move = () ->
	console.log("greedy ai move")
	if subboard_next.length >= 1
		subboard = subboard_next[-1..][0]
		selection = ais.first_unfilled(subboard)
