 			sortedPointTuple = pointSort( (@points[name] for name in tuple) )
 			nameTuple = (p.toString() for p in sortedPointTuple)
 			@tuples.push(sortedPointTuple)
-			@unfound_tuples.push(JSON.stringify(nameTuple)) # Note different data type from @tuples
+			@unfound_tuples.push(JSON.stringify(nameTuple))
+			# Note different data type from @tuples
 		@source = json_array["source"]
 		@filename = json_array["filename"]
 		@mistakes = 0
+		@active_points = []
+
+class Game
+	constructor: (@diagram_names) ->
+		CANVAS = $("<canvas></canvas>")
+		CANVAS.attr "height", CANVAS_HEIGHT
+		CANVAS.attr "width",  CANVAS_WIDTH
+		CANVAS.click onDiagramClick
+
+		CONTEXT = CANVAS.get(0).getContext("2d")
+		$("#site").empty()
+		$("#site").append(CANVAS)
+		$("#check_button").click onCheckButtonClick
+		$("#done_button").click onDoneButtonClick
+
 
 dist = (p, q) ->
 	Math.pow(Math.pow(p.x-q.x, 2) + Math.pow(p.y-q.y, 2), 0.5)


# }}}

# Geometry {{{
class Point
	constructor: (@name, @x, @y, @i) ->
		# no need to do anything, lol!

		toggle p

onCheckButtonClick = (e) ->
	clone = diagram.active_points.slice(0) # I hate JS
	stringifiedActive = JSON.stringify(
		(p.toString() for p in pointSort(clone)) )
	if stringifiedActive in diagram.unfound_tuples
		# Good job, delete it
		$("#found").append(
			$("<li>" + diagram.active_points.toString() + "</li>"))
		del(diagram.unfound_tuples, stringifiedActive)
		# Highlight green momentarily
		markAllActive("green")
		diagram.active_points = []
		setTimeout markAllActive, 400
		tempAddClass "#check_button", "button_green"
	else
