-- Love Console --

drawcmd = {}

cmdstr = ""

function love.draw()
	for k,v in pairs (drawcmd) do
		love.graphics.print(v,0,k*15)
		loadstring(v)()
	end
	
	love.graphics.print(cmdstr,0,600-30)
end

function love.update()
	
end

function love.keypressed(k,u)
	if k == "escape" then love.event.quit() end
	
	if #k == 1 then
		cmdstr = cmdstr..string.char(u)
	elseif k == "return" then
		table.insert(drawcmd,cmdstr)
		cmdstr = ""
	elseif k == "backspace" then
		cmdstr = string.sub(cmdstr,1,#cmdstr-1)
	end
end