 		spec = {
 			code: generateCode randInt 1, 20
 			input: []
-			pathInvalidatedAhead: Math.random() < 0.5
 		}
 
+		console.log 'running', spec.code
 		runSpec spec, executeList
-		console.log spec.code
 
 	return
 

	true


runSpec = (spec, executeList) ->
	{ code, input, pathInvalidatedAhead } = spec

	execute = executeList[0]
	firstResult = execute code, input, pathInvalidatedAhead

	(executeList.slice 1).forEach (execute, index) ->
		result = execute code, input, pathInvalidatedAhead

		if not arraysEqual firstResult.outRecord, result.outRecord
			throw new Error """

	programState


compile = (compiler, path) ->
	code ="""
			stack = programState.stack;
			#{compiler.assemble path}
		"""
	path.code = code
	path.body = new Function 'programState', code


makeExecute = (compiler) ->
	(code, input) ->
		path = getPath code
		compile compiler, path

		programState = getProgramState input
		path.body programState

		programState
