VRYBWP4QVBXHPTBBWTTZ7WH37MHAKNGYRI23P2JQWXMHFPFQE35QC
LD6DYF7WGWEH74LOIN5CNUU3O7QTX25BGTF2NU3IOHEEISZ5SNDAC
7YXBYZ7XWVBXI67WLBOOYBXTYGPI43YZOGL7RQ357YCLHHIKKFDQC
AS7RA27ZHCQBSR376TZIDULSGDBXZY7NAR2CWJDQ57D7FIGFASJQC
EZHO4TSWIYYUE73S6XQWIEF3HA3H7MKCNJOT27NTWTVSPVS2SL5QC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
NCOT5XN2HOABWDGPINZ3U2KI2NB3YDSG56TJX4JUOP6XFIDDXQ7AC
5OZWDTM6STGSEWIGWLESWLW47SDLTXYV2Z6EOHULQKALDPLTDM6QC
FOIVD5LONOOAGGFG3M4AT5KLVOB7WILZ4WH26BH7FOFPGXVPTLUQC
GOJ2S3WQ6JYJDM3LTBJI4OPDOW7GJRH2YPONP5UWHSDEMDVB5ADQC
WR54VAZ4RTED4MF5ZGOJMD437TFGFYLZF5YLU5KEZVCMMUD7WNMAC
LRDM35CEK3OHXOTB7TEFJRL7P6PQWO5ZG3F2BVA7DIDFHBPJQ7KAC
MD3W5IRAC6UQALQE4LJC52VQNDO3I3HXF3XE2XHDABXBYJBUVAXQC
WNNPZOCC7N7DJRYTJCGMPEQPNBFYRYVSYNZIFERVE3JLYUIYIHBQC
FS2ITYYHBLFT66YUC3ENPFYI2HOYHOVEPQIN7NQR6KF5MEK4NKZAC
2DVVKKVA6PJ7VKYLGPQ22AXUB6ZWFMPWB445PRDZJDNLURUFDNDQC
BPYWIU627AGHPXJ7KAZEYFJMUEVTCHQ624UHTLZ4VMAVOLZM255AC
D4FEFHQCSILZFQ5VLWNXAIRZNUMCDNGJSM4UJ6T6FDMMIWYRYILQC
ZTMRQZSWUL6FJRI4C4H37MR2IMV22DB6KRGEOUNYRWW5CTAVQFKAC
{"create_editor_panel":114,"Title_font":73,"Num_panels_horizontal":23,"Num_panels_vertical":24,"on.initialize":104,"draw_data":90,"Margin":27,"draw_editor_panel":109,"Font_size":28,"fw_parent":116,"create_editor":94,"fw_app":"bf","Data":102,"Code":101,"on.draw":108,"In":98,"draw_title":110,"Out":103,"on.mouse_press":112,"Cursor":38,"on.keychord_press":65,"Data_title_text":76,"on.text_input":66,"panel_bounds":93,"on":1}
{"draw_title":110,"Out":103,"Cursor":38,"on.keychord_press":122,"on.text_input":118,"panel_bounds":93,"editor_to_string":121,"eval":136,"map":123,"fw_parent":139,"Title_font":73,"fw_app":"bf","draw_editor_panel":140,"Num_panels_vertical":24,"on.draw":108,"on.initialize":104,"Data_title_text":76,"on.mouse_press":112,"Margin":27,"draw_data":90,"Font_size":28,"Data":102,"on":1,"create_editor":94,"create_editor_panel":114,"Code":101,"Num_panels_horizontal":23,"In":98}
{"panel_bounds":93,"editor_to_string":121,"on.key_release":152,"map":123,"on.mouse_release":154,"Cursor":38,"Title_font":73,"eval":155,"on.initialize":149,"on":1,"fw_parent":154,"Margin":27,"Data_title_text":76,"Font_size":28,"on.draw":108,"create_editor":94,"draw_editor_panel":140,"Code":101,"Num_panels_horizontal":23,"In":98,"Data":102,"Out":103,"on.keychord_press":153,"draw_title":110,"on.mouse_press":112,"create_editor_panel":114,"Num_panels_vertical":24,"draw_data":151,"fw_app":"bf","on.text_input":118}
{"panel_bounds":93,"editor_to_string":121,"on.key_release":152,"on.initialize":149,"map":123,"on":1,"Margin":27,"Title_font":73,"Font_size":28,"Cursor":38,"on.draw":108,"Data_title_text":76,"on.mouse_release":154,"In":98,"fw_parent":153,"Out":103,"fw_app":"bf","on.text_input":118,"Num_panels_vertical":24,"eval":148,"draw_data":151,"create_editor_panel":114,"Data":102,"draw_title":110,"Code":101,"draw_editor_panel":140,"create_editor":94,"on.keychord_press":153,"on.mouse_press":112,"Num_panels_horizontal":23}
{"create_editor_panel":114,"Title_font":73,"Num_panels_horizontal":23,"In_title_text":74,"Num_panels_vertical":24,"on.initialize":104,"draw_data":90,"Margin":27,"draw_editor_panel":109,"Font_size":28,"fw_parent":115,"create_editor":94,"fw_app":"bf","Data":102,"Code":101,"on.draw":108,"In":98,"draw_title":110,"Out":103,"on.mouse_press":112,"Cursor":38,"on.keychord_press":65,"Data_title_text":76,"on.text_input":66,"panel_bounds":93,"on":1}
{"draw_title":110,"Out":103,"Cursor":38,"on.keychord_press":122,"on.text_input":118,"panel_bounds":93,"editor_to_string":121,"eval":136,"map":123,"fw_parent":138,"Title_font":73,"fw_app":"bf","draw_editor_panel":139,"Num_panels_vertical":24,"on.draw":108,"on.initialize":104,"Data_title_text":76,"on.mouse_press":112,"Margin":27,"draw_data":90,"Font_size":28,"Data":102,"on":1,"create_editor":94,"create_editor_panel":114,"Code":101,"Num_panels_horizontal":23,"In":98}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
Out = create_editor(3, 1)
end
{"panel_bounds":93,"editor_to_string":121,"on.key_release":152,"on.initialize":149,"map":123,"on":1,"Margin":27,"Title_font":73,"Font_size":28,"Cursor":38,"on.draw":108,"Data_title_text":76,"In":98,"fw_parent":152,"Out":103,"fw_app":"bf","on.text_input":118,"Num_panels_vertical":24,"eval":148,"draw_data":151,"create_editor_panel":114,"Data":102,"draw_title":110,"Code":101,"draw_editor_panel":140,"create_editor":94,"on.keychord_press":153,"on.mouse_press":112,"Num_panels_horizontal":23}
{"create_editor_panel":114,"Title_font":73,"Num_panels_horizontal":23,"In_title_text":74,"Num_panels_vertical":24,"Code_title_text":75,"on.initialize":104,"draw_data":90,"Margin":27,"draw_editor_panel":109,"Font_size":28,"fw_parent":114,"create_editor":94,"fw_app":"bf","Data":102,"Code":101,"on.draw":108,"In":98,"draw_title":110,"Out":103,"on.mouse_press":112,"Cursor":38,"on.keychord_press":65,"Data_title_text":76,"on.text_input":66,"panel_bounds":93,"on":1}
draw_editor_panel = function(panel)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left, panel.top+Margin, panel.width, panel.height, 5,5)
draw_title(panel.title_text, panel.left, panel.top, panel.width)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
{"on.keychord_press":65,"on.text_input":66,"fw_app":"bf","Num_panels_horizontal":23,"Data":46,"on.initialize":68,"draw_data":63,"Margin":27,"Font_size":28,"Cursor":38,"on.mouse_press":67,"create_editor":62,"on.draw":49,"Code":31,"on":1,"In":32,"Num_panels_vertical":24,"Out":33,"fw_parent":67}
{"fw_app":"bf","In":98,"draw_title":110,"Out":103,"on.keychord_press":122,"Num_panels_horizontal":23,"on.text_input":118,"Num_panels_vertical":24,"editor_to_string":121,"on.initialize":104,"create_editor_panel":114,"Margin":27,"Title_font":73,"Data":102,"map":123,"create_editor":94,"Font_size":28,"Code":101,"Data_title_text":76,"on":1,"panel_bounds":93,"draw_data":90,"on.mouse_press":112,"eval":136,"on.draw":108,"Cursor":38,"fw_parent":135,"draw_editor_panel":109}
{"In":98,"draw_title":110,"Out":103,"on.keychord_press":65,"on.text_input":66,"panel_bounds":93,"Code":101,"on":1,"draw_data":90,"create_editor_panel":114,"Out_title_text":77,"fw_parent":113,"Title_font":73,"Num_panels_horizontal":23,"In_title_text":74,"Num_panels_vertical":24,"Code_title_text":75,"on.initialize":104,"Data_title_text":76,"fw_app":"bf","Margin":27,"on.mouse_press":112,"Font_size":28,"on.draw":108,"Data":102,"create_editor":94,"draw_editor_panel":109,"Cursor":38}
{"panel_bounds":93,"editor_to_string":121,"fw_parent":151,"Data":102,"map":123,"Title_font":73,"Num_panels_horizontal":23,"on.mouse_press":112,"on.key_release":152,"on.initialize":149,"Data_title_text":76,"fw_app":"bf","Margin":27,"draw_title":110,"Font_size":28,"on.draw":108,"eval":148,"create_editor":94,"draw_editor_panel":140,"Code":101,"Cursor":38,"In":98,"on":1,"Out":103,"create_editor_panel":114,"draw_data":151,"on.keychord_press":122,"Num_panels_vertical":24,"on.text_input":118}
{"draw_title":110,"Out":103,"Cursor":38,"on.keychord_press":122,"on.text_input":118,"panel_bounds":93,"editor_to_string":121,"eval":136,"map":123,"fw_parent":137,"Title_font":73,"fw_app":"bf","draw_editor_panel":138,"Num_panels_vertical":24,"on.draw":108,"on.initialize":104,"Data_title_text":76,"on.mouse_press":112,"Margin":27,"draw_data":90,"Font_size":28,"Data":102,"on":1,"create_editor":94,"create_editor_panel":114,"Code":101,"Num_panels_horizontal":23,"In":98}
on.mouse_press = function(x,y, mouse_button)
if x < In.right then
Cursor = In
edit.mouse_press(Cursor, x,y, mouse_button)
elseif x < Code.right then
if y < App.screen.height/2 then
Cursor = Code
edit.mouse_press(Cursor, x,y, mouse_button)
else
Cursor = Data
end
else
Cursor = Out
edit.mouse_press(Cursor, x,y, mouse_button)
end
end
{"create_editor":62,"Code":31,"In":32,"on.text_input":66,"Out":33,"on":1,"Cursor":38,"fw_app":"bf","Num_panels_horizontal":23,"Num_panels_vertical":24,"on.keychord_press":65,"on.initialize":56,"draw_data":63,"fw_parent":66,"Margin":27,"Data":46,"Font_size":28,"on.draw":49,"on.mouse_press":67}
draw_editor_panel = function(panel)
App.color{r=1,g=0,b=0}
love.graphics.line(Margin, 0, Margin, App.screen.height)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left, panel.top+Margin, panel.width, panel.height, 5,5)
draw_title(panel.title_text, panel.left, panel.top, panel.width)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
{"on.keychord_press":122,"on":1,"on.text_input":118,"panel_bounds":93,"editor_to_string":121,"map":123,"on.mouse_press":112,"draw_data":151,"Title_font":73,"Num_panels_horizontal":23,"create_editor_panel":114,"Num_panels_vertical":24,"Data":102,"on.initialize":149,"Data_title_text":76,"Out":103,"Margin":27,"eval":148,"Font_size":28,"on.draw":108,"fw_parent":150,"create_editor":94,"fw_app":"bf","Code":101,"draw_editor_panel":140,"In":98,"draw_title":110,"Cursor":38}
{"create_editor":62,"Code":31,"In":32,"on.text_input":66,"Out":33,"on":1,"Cursor":38,"fw_app":"bf","Num_panels_horizontal":23,"Num_panels_vertical":24,"on.keychord_press":65,"on.initialize":56,"draw_data":63,"fw_parent":65,"Margin":27,"Data":46,"Font_size":28,"on.draw":49,"on.mouse_press":64}
{"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.initialize":104,"Data":102,"Margin":27,"Font_size":28,"on.draw":108,"on.keychord_press":65,"create_editor":94,"on.text_input":66,"panel_bounds":93,"In":98,"create_editor_panel":113,"Out":103,"draw_title":110,"draw_editor_panel":109,"Title_font":73,"Cursor":38,"In_title_text":74,"on.mouse_press":112,"Code_title_text":75,"fw_app":"bf","Data_title_text":76,"fw_parent":112,"Out_title_text":77,"draw_data":90,"Code":101}
{"draw_title":110,"Out":103,"Cursor":38,"on.keychord_press":122,"on.text_input":118,"panel_bounds":93,"editor_to_string":121,"eval":136,"map":123,"fw_parent":136,"Title_font":73,"fw_app":"bf","draw_editor_panel":137,"Num_panels_vertical":24,"on.draw":108,"on.initialize":104,"Data_title_text":76,"on.mouse_press":112,"Margin":27,"draw_data":90,"Font_size":28,"Data":102,"on":1,"create_editor":94,"create_editor_panel":114,"Code":101,"Num_panels_horizontal":23,"In":98}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
print('== inst', cp, #code)
print('-- data')
for i,d in ipairs(Data) do
print(i,d)
end
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
if #In.editor.lines[1].data > 0 then
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
else
data[dp] = 0
end
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"create_editor":62,"Code":31,"In":32,"Out":33,"on":1,"Cursor":38,"fw_app":"bf","Num_panels_horizontal":23,"Num_panels_vertical":24,"on.keychord_press":65,"on.initialize":56,"draw_data":63,"fw_parent":64,"Margin":27,"Data":46,"Font_size":28,"on.draw":49,"on.mouse_press":64}
draw_editor_panel = function(panel)
App.color{r=1,g=0,b=0}
love.graphics.line(Margin, 0, Margin, App.screen.height)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left+Margin, panel.top+Margin, panel.width, panel.height, 5,5)
draw_title(panel.title_text, panel.left, panel.top, panel.width)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
create_editor_panel = function(col, row, title)
local left, top, panel_width, panel_height = panel_bounds(col, row)
local editor = edit.initialize_state(top+5+100, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(editor)
return {
left=left, top=top,
width=panel_width, height=panel_height,
editor=editor,
title_text=App.newText(Title_font, title),
}
end
{"create_editor":94,"Title_font":73,"Code":101,"on.keychord_press":122,"In":98,"on.text_input":118,"Out":103,"Data_title_text":76,"create_editor_panel":114,"draw_editor_panel":109,"Cursor":38,"Num_panels_vertical":24,"eval":135,"Data":102,"on":1,"fw_parent":134,"draw_title":110,"Num_panels_horizontal":23,"fw_app":"bf","on.mouse_press":112,"on.draw":108,"on.initialize":104,"draw_data":90,"panel_bounds":93,"Margin":27,"editor_to_string":121,"Font_size":28,"map":123}
on.mouse_press = function(x,y, mouse_button)
if x < In.right then
Cursor = In
elseif x < Code.right then
if y < App.screen.height/2 then
Cursor = Code
else
Cursor = Data
end
else
Cursor = Out
end
edit.mouse_press(Cursor, x,y, mouse_button)
end
{"Num_panels_vertical":24,"map":123,"on.initialize":149,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":148,"Code":101,"In":98,"fw_parent":149,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":150,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
{"create_editor":62,"Code":31,"In":32,"Out":33,"on":1,"Cursor":38,"fw_app":"bf","Num_panels_horizontal":23,"Num_panels_vertical":24,"on.initialize":56,"draw_data":63,"fw_parent":63,"Margin":27,"Data":46,"Font_size":28,"on.draw":49,"on.mouse_press":64}
{"create_editor":62,"Code":31,"In":32,"Out":33,"on":1,"Cursor":38,"fw_app":"bf","Num_panels_horizontal":23,"Num_panels_vertical":24,"on.initialize":56,"draw_data":63,"fw_parent":62,"Margin":27,"Data":46,"Font_size":28,"on.draw":49,"on.mouse_press":48}
{"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.initialize":104,"Data":102,"Margin":27,"Font_size":28,"on.draw":108,"on.keychord_press":65,"create_editor":94,"on.text_input":66,"panel_bounds":93,"In":98,"create_editor_panel":100,"Out":103,"draw_title":110,"draw_editor_panel":109,"Title_font":73,"Cursor":38,"In_title_text":74,"on.mouse_press":112,"Code_title_text":75,"fw_app":"bf","Data_title_text":76,"fw_parent":111,"Out_title_text":77,"draw_data":90,"Code":101}
draw_data = function(data)
-- assume data is in middle column, bottom half
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
y = draw_title(Data_title_text, left, top, panel_width)
x = x + 20
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
local mode = 'line'
if i == data.p then
mode = 'fill'
end
love.graphics.rectangle(mode, x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
on.mouse_press = function(x,y, mouse_button)
if x < In.editor.right then
Cursor = In
edit.mouse_press(Cursor, x,y, mouse_button)
elseif x < Code.editor.right then
if y < App.screen.height/2 then
Cursor = Code
edit.mouse_press(Cursor, x,y, mouse_button)
else
Cursor = Data
end
else
Cursor = Out
edit.mouse_press(Cursor, x,y, mouse_button)
end
end
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
print('== inst', cp, #code)
print('-- data')
for i,d in ipairs(Data) do
print(i,d)
end
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
print('out')
print(dp, data[dp])
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print('in')
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
if #In.editor.lines[1].data > 0 then
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
else
data[dp] = 0
end
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"Cursor":38,"Num_panels_horizontal":23,"on.mouse_press":48,"on.initialize":56,"draw_data":61,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":62,"Code":31,"Data":46,"In":32,"Out":33,"fw_app":"bf","Num_panels_vertical":24,"on":1,"fw_parent":61}
{"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.initialize":104,"Data":102,"Margin":27,"Font_size":28,"on.draw":108,"on.keychord_press":65,"create_editor":94,"on.text_input":66,"panel_bounds":93,"In":98,"create_editor_panel":100,"Out":103,"draw_title":110,"draw_editor_panel":109,"Title_font":73,"Cursor":38,"In_title_text":74,"on.mouse_press":111,"Code_title_text":75,"fw_app":"bf","Data_title_text":76,"fw_parent":110,"Out_title_text":77,"draw_data":90,"Code":101}
{"eval":134,"Num_panels_horizontal":23,"fw_parent":133,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
{"Num_panels_vertical":24,"map":123,"on.initialize":149,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":148,"Code":101,"In":98,"fw_parent":148,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":147,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
create_editor = function(col, row)
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal + 1)) / Num_panels_horizontal
local left = (col - 1) * (Margin + panel_width) + Margin
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]
local top = (row - 1) * (Margin + panel_height) + Margin
local result = edit.initialize_state(top+5, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(result)
return result
end
{"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.initialize":104,"Data":102,"Margin":27,"Font_size":28,"on.draw":108,"on.keychord_press":65,"create_editor":94,"on.text_input":66,"panel_bounds":93,"In":98,"create_editor_panel":100,"Out":103,"draw_title":110,"draw_editor_panel":109,"Title_font":73,"Cursor":38,"In_title_text":74,"on.mouse_press":67,"Code_title_text":75,"fw_app":"bf","Data_title_text":76,"fw_parent":109,"Out_title_text":77,"draw_data":90,"Code":101}
{"Cursor":38,"Num_panels_horizontal":23,"on.mouse_press":48,"on.initialize":56,"draw_data":61,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Data":46,"In":32,"Out":33,"fw_app":"bf","Num_panels_vertical":24,"on":1,"fw_parent":60}
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":148,"Code":101,"In":98,"fw_parent":147,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":147,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
{"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.initialize":104,"Data":102,"Margin":27,"Font_size":28,"on.draw":108,"on.keychord_press":65,"create_editor":94,"on.text_input":66,"panel_bounds":93,"In":98,"create_editor_panel":100,"Out":103,"draw_title":89,"draw_editor_panel":109,"Title_font":73,"Cursor":38,"In_title_text":74,"on.mouse_press":67,"Code_title_text":75,"fw_app":"bf","Data_title_text":76,"fw_parent":108,"Out_title_text":77,"draw_data":90,"Code":101}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
print('== inst', cp, #code)
print('-- data')
for i,d in ipairs(Data) do
print(i,d)
end
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
print('out')
print(dp, data[dp])
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print('in')
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
print(x,y, App.screen.width, App.screen.height, #data)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
draw_editor_panel = function(panel)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left+Margin, panel.top+Margin, panel.width, panel.height, 5,5)
draw_title(panel.title_text, panel.left, panel.top, panel.width)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
{"Cursor":38,"Num_panels_horizontal":23,"on.mouse_press":48,"on.initialize":56,"draw_data":60,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Data":46,"In":32,"Out":33,"fw_app":"bf","Num_panels_vertical":24,"on":1,"fw_parent":59}
{"eval":133,"Num_panels_horizontal":23,"fw_parent":132,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
eval = function(code, data)
local cp, dp = 1, data.p
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
if #In.editor.lines[1].data > 0 then
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
else
data[dp] = 0
end
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
data.p = dp
end
{"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.initialize":104,"Data":102,"Margin":27,"Font_size":28,"on.draw":108,"on.keychord_press":65,"create_editor":94,"on.text_input":66,"panel_bounds":93,"In":98,"create_editor_panel":100,"Out":103,"draw_title":89,"draw_editor_panel":107,"Title_font":73,"Cursor":38,"In_title_text":74,"on.mouse_press":67,"Code_title_text":75,"fw_app":"bf","Data_title_text":76,"fw_parent":107,"Out_title_text":77,"draw_data":90,"Code":101}
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
print(x,y, App.screen.width, App.screen.height, #data)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":146,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":147,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
{"Cursor":38,"Num_panels_horizontal":23,"on.mouse_press":48,"on.initialize":56,"draw_data":59,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Data":46,"In":32,"Out":33,"fw_app":"bf","Num_panels_vertical":24,"on":1,"fw_parent":58}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":102,"draw_data":90,"In_title_text":74,"on.initialize":104,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"on.keychord_press":65,"Out":103,"panel_bounds":93,"Title_font":73,"fw_parent":104,"fw_app":"bf","Font_size":28,"Margin":27,"Cursor":38,"create_editor":94,"draw_editor_panel":107,"on.text_input":66,"Num_panels_vertical":24,"draw_title":89,"on":1,"create_editor_panel":100}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
print('== inst', cp, #code)
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
print('out')
print(dp, data[dp])
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print('in')
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
draw_data = function(data)
-- assume data is in middle column, bottom half
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
y = draw_title(Data_title_text, left, top, panel_width)
x = x + 20
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
draw_editor_panel = function(panel)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left+Margin, panel.top+Margin, panel_width, panel_height, 5,5)
draw_title(panel.title_text, panel.left, panel.top, panel.width)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 5
local y = Margin + panel_height + Margin + 5
print(x,y, App.screen.width, App.screen.height, #data)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 5
end
end
end
{"eval":132,"Num_panels_horizontal":23,"fw_parent":131,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
{"Cursor":38,"Num_panels_horizontal":23,"on.mouse_press":48,"on.initialize":56,"draw_data":58,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Data":46,"In":32,"Out":33,"fw_app":"bf","Num_panels_vertical":24,"on":1,"fw_parent":56}
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":145,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":146,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":102,"draw_data":90,"In_title_text":74,"on.initialize":104,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"draw_editor_panel(panel)":106,"Out":103,"panel_bounds":93,"Title_font":73,"fw_parent":104,"fw_app":"bf","Font_size":28,"Margin":27,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Num_panels_vertical":24,"draw_title":89,"on":1,"create_editor_panel":100}
draw_editor_panel(panel)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left+Margin, panel.top+Margin, panel_width, panel_height, 5,5)
draw_title(panel.title_text, panel.left, panel.top, panel.width)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
print(x,y, App.screen.width, App.screen.height, #data)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin
end
end
end
draw_data = function(data)
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
y = draw_title(Data_title_text, left, top, panel_width)
x = x + 20
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":102,"draw_data":90,"In_title_text":74,"on.initialize":104,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"draw_editor_panel(panel)":105,"Out":103,"Title_font":73,"panel_bounds":93,"fw_parent":104,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":100}
{"Cursor":38,"Num_panels_horizontal":23,"on.mouse_press":48,"on.initialize":56,"draw_data":57,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Data":46,"In":32,"Out":33,"fw_app":"bf","Num_panels_vertical":24,"on":1,"fw_parent":56}
draw_editor_panel(panel)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', panel.left+Margin, panel.top+Margin, panel_width, panel_height, 5,5)
edit.draw(panel.editor, Text_color, Cursor ~= panel)
end
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
print('== inst', cp)
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
print('out')
print(dp, data[dp])
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print('in')
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":144,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":145,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor_panel(1,1, 'In')
Code = create_editor_panel(2,1, 'Code')
Out = create_editor_panel(3,1, 'Out')
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
Data[1] = 3
Data[2] = 4
Data_title_text = App.newText(Title_font, 'Data')
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
print(x,y, App.screen.width, App.screen.height, #data)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin
end
end
{"eval":131,"Num_panels_horizontal":23,"fw_parent":130,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
print(Code)
Data = {}
print('data')
for i=1,10 do
table.insert(Data, 0)
end
Out = create_editor(3, 1)
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":102,"draw_data":90,"In_title_text":74,"on.initialize":104,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"Out":103,"Title_font":73,"panel_bounds":93,"fw_parent":103,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":100}
{"Num_panels_vertical":24,"on.mouse_press":48,"on.initialize":56,"draw_data":55,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Cursor":38,"Out":33,"Data":46,"In":32,"Num_panels_horizontal":23,"fw_parent":55,"on":1,"fw_app":"bf"}
draw_data = function(data)
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
y = draw_title(Data_title_text, x,y, panel_width)
x = x + 20
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"Num_panels_vertical":24,"on.mouse_press":48,"on.initialize":47,"draw_data":55,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Cursor":38,"Out":33,"Data":46,"In":32,"Num_panels_horizontal":23,"fw_parent":54,"on":1,"fw_app":"bf"}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":102,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"Out":103,"Title_font":73,"panel_bounds":93,"fw_parent":102,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":100}
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":143,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":144,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
print('out')
print(dp, data[dp])
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print('in')
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
print(x,y, App.screen.width, App.screen.height, #data)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":102,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":101,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":100}
{"Num_panels_vertical":24,"on.mouse_press":48,"on.initialize":47,"draw_data":54,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Cursor":38,"Out":33,"Data":46,"In":32,"Num_panels_horizontal":23,"fw_parent":53,"on":1,"fw_app":"bf"}
{"eval":130,"Num_panels_horizontal":23,"fw_parent":129,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
draw_data = function(data)
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin
y = draw_title(Data_title_text, x,y, panel_width)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":101,"In":98,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":100,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":100}
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
print(x,y, App.screen.width, App.screen.height)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
end
end
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":142,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":143,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":98,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":99,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":100}
{"Num_panels_vertical":24,"on.mouse_press":48,"on.initialize":47,"draw_data":53,"Margin":27,"Font_size":28,"on.draw":49,"create_editor":37,"Code":31,"Cursor":38,"Out":33,"Data":46,"In":32,"Num_panels_horizontal":23,"fw_parent":52,"on":1,"fw_app":"bf"}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
data[dp] = string.byte(In.editor.lines[1].data:sub(1,1))
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
create_editor_panel = function(col, row, title)
local left, top, panel_width, panel_height = panel_bounds(col, row)
local editor = edit.initialize_state(top+5, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(editor)
return {
left=left, top=top,
width=panel_width, height=panel_height,
editor=editor,
title_text=App.newText(Title_font, title),
}
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
print(x,y)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
end
end
draw_data = function(data)
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
y = draw_title(Data_title_text, x,y, panel_width)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"eval":129,"Num_panels_horizontal":23,"fw_parent":128,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
{"Code":31,"Cursor":38,"on":1,"on.mouse_press":48,"Data":46,"fw_app":"bf","on.draw":49,"Num_panels_horizontal":23,"Num_panels_vertical":24,"on.initialize":47,"Margin":27,"fw_parent":51,"Font_size":28,"draw_data":52,"Out":33,"create_editor":37,"In":32}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":98,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":98,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":99}
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":141,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":142,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
create_editor_panel = function(col, row, title)
local left, top, panel_width, panel_height = panel_bounds(col, row)
local editor = edit.initialize_state(top+5, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(editor)
return {
left=left, top=top,
width=panel_width, height=panel_height,
editor=editor,
title_text=Ap.newText(Title_font, title),
}
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x,y)
x = x+80
end
end
{"Code":31,"Cursor":38,"on":1,"on.mouse_press":48,"Data":46,"fw_app":"bf","on.draw":49,"Num_panels_horizontal":23,"Num_panels_vertical":24,"on.initialize":47,"Margin":27,"fw_parent":50,"Font_size":28,"draw_data":51,"Out":33,"create_editor":37,"In":32}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":98,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":97,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":97}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print(In)
print(In.editor)
print(In.editor.lines[1].data)
print(In.editor.lines[1].data[1])
data[dp] = string.byte(In.editor.lines[1].data[1])
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
draw_data = function(data)
local left, top, panel_width, panel_height = panel_bounds(2, 2)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
y = draw_title(Data_title_text, x,y, panel_width)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin
local y = Margin + panel_height + Margin
for i,d in ipairs(data) do
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":96,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":97}
{"Code":31,"Cursor":38,"on":1,"on.mouse_press":48,"Data":46,"fw_app":"bf","on.draw":49,"Num_panels_horizontal":23,"Num_panels_vertical":24,"on.initialize":47,"Margin":27,"fw_parent":49,"Font_size":28,"draw_data":50,"Out":33,"create_editor":37,"In":32}
{"eval":128,"Num_panels_horizontal":23,"fw_parent":127,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
{"Num_panels_vertical":24,"map":123,"on.initialize":104,"Title_font":73,"Margin":27,"on.mouse_press":112,"on.draw":108,"Data_title_text":76,"eval":136,"Code":101,"In":98,"fw_parent":140,"draw_editor_panel":140,"Out":103,"Cursor":38,"Num_panels_horizontal":23,"create_editor_panel":114,"create_editor":94,"on":1,"draw_title":110,"Data":102,"Font_size":28,"draw_data":141,"on.keychord_press":122,"fw_app":"bf","on.text_input":118,"panel_bounds":93,"editor_to_string":121}
create_editor_panel = function(col, row, title)
local left, top, panel_width, panel_height = panel_bounds(col, row)
local editor = edit.initialize_state(top+5, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(editor)
return {
left=left, top=top,
width=panel_width, height=panel_height,
title_text=Ap.newText(Title_font, title),
}
end
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)
y = y + Margin + panel_height
end
x = x + Margin + panel_width
end
edit.draw(In, Text_color, Cursor ~= In)
edit.draw(Code, Text_color, Cursor ~= Code)
edit.draw(Out, Text_color, Cursor ~= Out)
draw_data(Data)
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":95,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":96}
draw_data = function(data)
local left, top, panel_width, panel_height = panel_bounds(2, 1)
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', left, top, panel_width, panel_height, 5,5)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
y = draw_title(Data_title_text, x,y, panel_width)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"Code":31,"create_editor":37,"Num_panels_horizontal":23,"on.initialize":47,"Num_panels_vertical":24,"Font_size":28,"on":1,"Cursor":38,"on.mouse_press":48,"Data":46,"In":32,"fw_app":"bf","on.draw":49,"Margin":27,"Out":33,"fw_parent":48}
create_editor_panel = function(col, row)
local left, top, panel_width, panel_height = panel_bounds(col, row)
local editor = edit.initialize_state(top+5, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(editor)
end
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
print(In)
print(In.editor)
print(In.editor.lines[1].data)
data[dp] = string.byte(In.editor.lines[1].data[1])
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"Code":31,"create_editor":37,"Num_panels_horizontal":23,"on.initialize":47,"Num_panels_vertical":24,"Font_size":28,"on":1,"Cursor":38,"on.mouse_press":48,"Data":46,"In":32,"fw_app":"bf","on.draw":45,"Margin":27,"Out":33,"fw_parent":47}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"Title_font":73,"panel_bounds":93,"fw_parent":94,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"create_editor_panel":95}
{"eval":127,"Num_panels_horizontal":23,"fw_parent":126,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
print(Code)
Data = create_editor(2, 2)
Out = create_editor(3, 1)
end
{"Code":31,"Num_panels_horizontal":23,"on.initialize":47,"Num_panels_vertical":24,"Font_size":28,"on":1,"Cursor":38,"create_editor":37,"Data":46,"In":32,"fw_app":"bf","on.draw":45,"Margin":27,"Out":33,"fw_parent":46}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"panel_bounds":93,"fw_parent":93,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":94,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
{"Out":33,"Data":46,"In":32,"Num_panels_horizontal":23,"Margin":27,"Cursor":38,"fw_parent":45,"on":1,"fw_app":"bf","create_editor":37,"on.draw":45,"Code":31,"Font_size":28,"Num_panels_vertical":24,"on.initialize":36}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
data[dp] = string.byte(In.editor.lines[1].data[1])
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)
y = y + Margin + panel_height
end
x = x + Margin + panel_width
end
edit.draw(In, Text_color, Cursor ~= In)
edit.draw(Code, Text_color, Cursor ~= Code)
edit.draw(Data, Text_color, Cursor ~= Data)
edit.draw(Out, Text_color, Cursor ~= Out)
end
{"eval":126,"Num_panels_horizontal":23,"fw_parent":125,"draw_title":110,"fw_app":"bf","on":1,"draw_data":90,"Margin":27,"panel_bounds":93,"editor_to_string":121,"on.mouse_press":112,"create_editor":94,"map":123,"Code":101,"Cursor":38,"Title_font":73,"on.draw":108,"Out":103,"In":98,"Font_size":28,"on.keychord_press":122,"Data_title_text":76,"on.text_input":118,"Data":102,"Num_panels_vertical":24,"on.initialize":104,"draw_editor_panel":109,"create_editor_panel":114}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"panel_bounds":93,"fw_parent":92,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
{"Out":33,"In":32,"Num_panels_horizontal":23,"Margin":27,"Cursor":38,"fw_parent":44,"on":1,"fw_app":"bf","create_editor":37,"on.draw":45,"Code":31,"Font_size":28,"Num_panels_vertical":24,"on.initialize":36}
panel_bounds = function(col, row)
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal + 1)) / Num_panels_horizontal
local left = (col - 1) * (Margin + panel_width) + Margin
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]
local top = (row - 1) * (Margin + panel_height) + Margin
local result = edit.initialize_state(top+5, left+5, left+panel_width-5, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(result)
return result
end
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)
y = y + Margin + panel_height
end
x = x + Margin + panel_width
end
edit.draw(In, Text_color, Cursor == In)
edit.draw(Code, Text_color, Cursor == Code)
edit.draw(Data, Text_color, Cursor == Data)
edit.draw(Out, Text_color, Cursor == Out)
end
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
Out.editor.lines[1].data = Out.editor.lines[1].data..string.char(data[dp])
Text.redraw_all(Out.editor)
--print(string.char(data[dp]))
--print(data[dp])
elseif inst == ',' then
--data[dp] = string.byte(io.read(1))
data[dp] = In.editor.lines[1].data[1]
In.editor.lines[1].data = In.editor.lines[1].data:sub(2)
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"panel_bounds":92,"fw_parent":91,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
{"Out":33,"In":32,"Num_panels_horizontal":23,"Margin":27,"Cursor":38,"fw_parent":43,"on":1,"fw_app":"bf","create_editor":37,"on.draw":44,"Code":31,"Font_size":28,"Num_panels_vertical":24,"on.initialize":36}
{"draw_editor_panel":109,"fw_parent":124,"fw_app":"bf","map":123,"draw_title":110,"panel_bounds":93,"eval":125,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"editor_to_string":121,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":122,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)
y = y + Margin + panel_height
end
x = x + Margin + panel_width
end
edit.draw(In, Text_color, Cursor ~= In)
edit.draw(Code, Text_color, Cursor ~= Code)
edit.draw(Out, Text_color, Cursor ~= Out)
draw_data(Data)
end
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+Margin, y+margin, panel_width, panel_height, 5,5)
y = y + Margin + panel_height
end
x = x + Margin + panel_width
end
edit.draw(In, Text_color, Cursor == In)
edit.draw(Code, Text_color, Cursor == Code)
edit.draw(Data, Text_color, Cursor == Data)
edit.draw(Out, Text_color, Cursor == Out)
end
{"Out":33,"In":32,"Num_panels_horizontal":23,"Margin":27,"Cursor":38,"fw_parent":42,"on":1,"fw_app":"bf","create_editor":37,"on.draw":43,"Code":31,"Font_size":28,"Num_panels_vertical":24,"on.initialize":36}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":91,"Code":31,"In":32,"Out":33,"fw_parent":90,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[' , cp, --[[plain]] true)
end
elseif inst == '.' then
--print(string.char(data[dp]))
print(data[dp])
elseif inst == ',' then
data[dp] = string.byte(io.read(1))
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":90,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":89,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
{"draw_editor_panel":109,"fw_parent":123,"fw_app":"bf","map":123,"draw_title":110,"panel_bounds":93,"eval":124,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"editor_to_string":121,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":122,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+Margin, y+margin, panel_width, panel_height, 5,5)
y = y + Margin + panel_height
end
x = x + Margin + panel_width
end
edit.draw(In, Text_color, Cursor == In)
edit.draw(Code, Text_color, Cursor == Code)
edit.draw(Data, Text_color, Cursor == Data)
edit.draw(Out, Text_color, Cursor == Out)
end
{"Out":33,"In":32,"Num_panels_horizontal":23,"Margin":27,"Cursor":38,"fw_parent":41,"on":1,"fw_app":"bf","create_editor":37,"on.draw":42,"Code":31,"Font_size":28,"Num_panels_vertical":24,"on.initialize":36}
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
y = draw_title(Data_title_text, x,y, panel_width)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp, --[[plain]] true)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[', cp)
end
elseif inst == '.' then
--print(string.char(data[dp]))
print(data[dp])
elseif inst == ',' then
data[dp] = string.byte(io.read(1))
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":87,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":88,"draw_title":89,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,Num_panels_horizontal do
local panel_height = (App.screen.height - margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]
local y = 0
for j = 1,Num_panels_vertical[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
edit.draw(In, Text_color, Cursor == In)
edit.draw(Code, Text_color, Cursor == Code)
edit.draw(Data, Text_color, Cursor == Data)
edit.draw(Out, Text_color, Cursor == Out)
end
draw_title = function(text, panelx, panely, panel_width)
-- draw title text at top-right of panel whose top-left is panelx,panely
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(text, panelx + panel_width - App.width(text) - Margin*2, panely)
return panely + 100
end
{"Out":33,"In":32,"Num_panels_horizontal":23,"Margin":27,"Cursor":38,"fw_parent":40,"on":1,"fw_app":"bf","create_editor":37,"on.draw":41,"Code":31,"Font_size":28,"Num_panels_vertical":24,"on.initialize":36}
{"draw_editor_panel":109,"fw_parent":122,"fw_app":"bf","map":123,"draw_title":110,"panel_bounds":93,"eval":120,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"editor_to_string":121,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":122,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":87,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":87,"draw_title":88,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
draw_title = function(text, panelx, panely, panel_width)
-- draw title text at top-right of panel whose top-left is panelx,panely
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(Data_title_text, x + panel_width - App.width(Data_title_text) - Margin*2, y)
end
{"draw_editor_panel":109,"fw_parent":121,"fw_app":"bf","draw_title":110,"panel_bounds":93,"eval":120,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"editor_to_string":121,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":122,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
on.draw = function()
assert(#Num_panels_vertical == Num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
edit.draw(In, Text_color, Cursor == In)
edit.draw(Code, Text_color, Cursor == Code)
edit.draw(Data, Text_color, Cursor == Data)
edit.draw(Out, Text_color, Cursor == Out)
end
{"Out":33,"on.initialize":36,"Num_panels_vertical":24,"Margin":27,"fw_app":"bf","Font_size":28,"Cursor":38,"fw_parent":39,"create_editor":37,"on.draw":40,"Code":31,"In":32,"Num_panels_horizontal":23,"on":1}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":87,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":86,"draw_title":86,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
{"draw_editor_panel":109,"fw_parent":120,"fw_app":"bf","draw_title":110,"panel_bounds":93,"eval":120,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"editor_to_string":121,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":119,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
y = y + 100
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
on.draw = function()
assert(#Num_panels_vertical == num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
edit.draw(In, Text_color, Cursor == In)
edit.draw(Code, Text_color, Cursor == Code)
edit.draw(Data, Text_color, Cursor == Data)
edit.draw(Out, Text_color, Cursor == Out)
end
{"draw_editor_panel":109,"fw_parent":119,"fw_app":"bf","draw_title":110,"eval":120,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"panel_bounds":93,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":119,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
{"In":32,"on":1,"Out":33,"on.initialize":36,"Cursor":38,"Num_panels_vertical":24,"Margin":27,"Num_panels_horizontal":23,"Font_size":28,"on.draw":39,"fw_parent":38,"create_editor":37,"fw_app":"bf","Code":31}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":85,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":85,"draw_title":86,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
{"In":32,"on":1,"Out":33,"on.initialize":36,"Cursor":38,"Num_panels_vertical":24,"Margin":27,"Num_panels_horizontal":23,"Font_size":28,"on.draw":35,"fw_parent":37,"create_editor":37,"fw_app":"bf","Code":31}
eval = function(code, data)
local cp,dp = 1,1
while cp <= #code do
local inst = code:sub(cp,cp)
if inst == '<' then
dp = dp-1
elseif inst == '>' then
dp = dp+1
elseif inst == '+' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]+1
elseif inst == '-' then
if data[dp] == nil then data[dp] = 0 end
data[dp] = data[dp]-1
elseif inst == '[' then
if data[dp] == 0 then
cp = code:find(']', cp)
end
elseif inst == ']' then
if data[dp] ~= 0 then
cp = rfind(code, '[', cp)
end
elseif inst == '.' then
--print(string.char(data[dp]))
print(data[dp])
elseif inst == ',' then
data[dp] = string.byte(io.read(1))
elseif inst == '#' then
cp = code:find('\n', cp)
end
cp = cp+1
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":85,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":84,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
create_editor = function(col, row)
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal + 1)) / Num_panels_horizontal
local left = (col - 1) * (Margin + panel_width) + Margin
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]
local top = (row - 1) * (Margin + panel_height) + Margin
local result = edit.initialize_state(top, left, left+panel_width, Font_size, math.floor(Font_size*1.3))
Text.redraw_all(result)
return result
end
{"draw_editor_panel":109,"fw_parent":118,"fw_app":"bf","draw_title":110,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"panel_bounds":93,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":119,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
print(Code)
Data = create_editor(2, 2)
Out = create_editor(3, 1)
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
App.color{r=0.7,g=0.7,b=0.7}
y = y + 100
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
love.graphics.draw(Data_title_text, x + panel_width - Data_title_text:getWidth() - Margin*2, y)
{"draw_editor_panel":109,"fw_parent":117,"fw_app":"bf","draw_title":110,"Num_panels_horizontal":23,"on":1,"Num_panels_vertical":24,"on.text_input":118,"on.initialize":104,"draw_data":90,"panel_bounds":93,"Margin":27,"create_editor_panel":114,"Font_size":28,"on.draw":108,"Title_font":73,"create_editor":94,"Data":102,"Code":101,"on.keychord_press":65,"In":98,"Data_title_text":76,"Out":103,"Cursor":38,"on.mouse_press":112}
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":84,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":83,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
on.draw = function()
edit.draw(In)
edit.draw(Code)
edit.draw(Data)
edit.draw(Out)
assert(#Num_panels_vertical == num_panels_horizontal)
App.color{r=0.5,g=0.5,b=0.5}
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(Data_title_text, x + panel_width - App.width(Data_title_text) - Margin*2, y)
y = y + 30
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = create_editor(2, 2)
Out = create_editor(3, 1)
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":83,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":82,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(Data_title_text, x + panel_width - App.width(Data_title_text) - Margin*2, y)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":82,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":81,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
create_editor = function(col, row)
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal + 1)) / Num_panels_horizontal
local left = (col - 1) * (Margin + panel_width) + Margin
local panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]
local top = (row - 1) * (Margin + panel_height) + Margin
return edit.initialize_state(top, left, left+panel_width, Font_size, math.floor(Font_size*1.3))
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(Data_title_text, x + panel_width - App.width(Data_title_text) - Margin*2, y + 20)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"on.mouse_press":67,"Num_panels_horizontal":23,"Data":46,"draw_data":81,"In_title_text":74,"on.initialize":79,"Code_title_text":75,"Data_title_text":76,"Out_title_text":77,"on.draw":49,"Code":31,"In":32,"Out":33,"fw_parent":80,"Font_size":28,"Num_panels_vertical":24,"Cursor":38,"create_editor":62,"on.keychord_press":65,"on.text_input":66,"Margin":27,"fw_app":"bf","on":1,"Title_font":73}
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(Data_title_text, x + panel_width - App.width(Data_title_text) - Margin, y + 20)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
{"In_title_text":74,"Out_title_text":77,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":79,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Code_title_text":75,"Data_title_text":76,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":80,"Num_panels_vertical":24,"Code":31,"on.initialize":79}
on.draw = function()
-- draw a grid of equally-sized columns, each containing some number of equally-sized panels
local num_panels_hor = 3
local num_panels_ver = {1,2,1} -- number of vertical panels by column
assert(#num_panels_ver == num_panels_hor)
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
draw_data = function(data)
-- assumes data is in middle column, bottom half
local panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontal
local panel_height = (App.screen.height - Margin*3) / 2
local x = Margin + panel_width + Margin + 20
local y = Margin + panel_height + Margin + 20
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.draw(Data_title_text, x + panel_width*2/3, y + 20)
for i,d in ipairs(data) do
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
App.color{r=0,g=0,b=0}
love.graphics.print(d, x+2,y)
x = x+80
if i%5 == 0 then
y = y + 40
x = Margin + panel_width + Margin + 20
end
end
end
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
Data[1] = 3
Data[2] = 4
Out = create_editor(3, 1)
In_title_text = App.newText(Title_font, 'In')
Code_title_text = App.newText(Title_font, 'Code')
Data_title_text = App.newText(Title_font, 'Data')
Out_title_text = App.newText(Title_font, 'Out')
end
on.draw = function()
-- draw a grid of equally-sized columns, each containing some number of equally-sized panels
local num_panels_hor = 3
local num_panels_ver = {3,4,1} -- number of vertical panels by column
assert(#num_panels_ver == num_panels_hor)
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
{"In_title_text":74,"Out_title_text":77,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":78,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Code_title_text":75,"Data_title_text":76,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":79}
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor = 3
local num_panels_ver = {3,4,1} -- number of vertical panels by column
assert(#num_panels_ver == num_panels_hor)
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
data[1] = 3
data[2] = 4
Out = create_editor(3, 1)
In_title_text = App.newText(Title_font, 'In')
Code_title_text = App.newText(Title_font, 'Code')
Data_title_text = App.newText(Title_font, 'Data')
Out_title_text = App.newText(Title_Font, 'Out')
end
{"In_title_text":74,"Out_title_text":77,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":77,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Code_title_text":75,"Data_title_text":76,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":78}
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor = 3
local num_panels_ver = {1,2,1} -- number of vertical panels by column
assert(#num_panels_ver == num_panels_hor)
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver[i] do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
{"In_title_text":74,"Out_title_text":77,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":76,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Code_title_text":75,"Data_title_text":76,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":72}
{"In_title_text":74,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":75,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Code_title_text":75,"Data_title_text":76,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":72}
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor = 3
local num_panels_ver = {1,2,1} -- number of vertical panels by column
assert(#num_panels_ver == num_panels_hor)
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local x = 0
for i = 1,num_panels_hor do
local panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]
local y = 0
for j = 1,num_panels_ver do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
{"In_title_text":74,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":74,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Code_title_text":75,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":72}
{"In_title_text":74,"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":73,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":72}
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor, num_panels_ver = 3, 1 -- vary this
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_hor do
y = 0
for j = 1,num_panels_ver do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
{"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":72,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Title_font":73,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":72}
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor, num_panels_ver = 3, 6 -- vary this
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_hor do
y = 0
for j = 1,num_panels_ver do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
end
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
data[1] = 3
data[2] = 4
Out = create_editor(3, 1)
end
{"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":70,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":72}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
data[1] = 3
data[2] =
Out = create_editor(3, 1)
end
{"Margin":27,"create_editor":62,"Font_size":28,"on.draw":49,"fw_parent":70,"In":32,"fw_app":"bf","Out":33,"on.keychord_press":65,"on.text_input":66,"Data":46,"on":1,"on.mouse_press":67,"Cursor":38,"Num_panels_horizontal":23,"draw_data":63,"Num_panels_vertical":24,"Code":31,"on.initialize":71}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
Data[1] = 3
Out = create_editor(3, 1)
end
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor, num_panels_ver = 3, 1 -- vary this
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_ver do
x = 0
for j = 1,num_panels_hor do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
x = x + margin + panel_width
end
y = y + margin + panel_height
end
end
{"Margin":27,"on":1,"on.draw":49,"create_editor":62,"Code":31,"In":32,"Out":33,"Cursor":38,"on.keychord_press":65,"on.text_input":66,"fw_parent":69,"Font_size":28,"fw_app":"bf","Num_panels_horizontal":23,"on.mouse_press":67,"Num_panels_vertical":24,"on.initialize":70,"draw_data":63,"Data":46}
on.initialize = function()
local font = love.graphics.newFont(Font_size)
love.graphics.setFont(font)
In = create_editor(1, 1)
Code = create_editor(2, 1)
Data = {}
for i=1,10 do
table.insert(Data, 0)
end
table[1] = 3
Out = create_editor(3, 1)
end
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor, num_panels_ver = 5, 2 -- vary this
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_ver do
x = 0
for j = 1,num_panels_hor do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
x = x + margin + panel_width
end
y = y + margin + panel_height
end
end
{"Cursor":38,"create_editor":62,"fw_app":"bf","Data":46,"In":32,"fw_parent":68,"Num_panels_vertical":24,"on.keychord_press":65,"on.text_input":66,"on.draw":49,"on":1,"on.mouse_press":67,"Out":33,"on.initialize":69,"draw_data":63,"Code":31,"Margin":27,"Num_panels_horizontal":23,"Font_size":28}
on.draw = function()
-- draw a grid of equally-sized panels
local num_panels_hor, num_panels_ver = 3, 2 -- vary this
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_ver do
x = 0
for j = 1,num_panels_hor do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
x = x + margin + panel_width
end
y = y + margin + panel_height
end
end
on.draw = function()
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local num_panels_hor, num_panels_ver = 3, 1
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_ver do
x = 0
for j = 1,num_panels_hor do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
x = x + margin + panel_width
end
y = y + margin + panel_height
end
end
on.draw = function()
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local num_panels_hor, num_panels_ver = 3, 1
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i in 1,num_panels_ver do
x = 0
for j in 1,num_panels_hor do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
x = x + margin + panel_width
end
y = y + margin + panel_height
end
end
on.draw = function()
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local num_panels_hor, num_panels_ver = 3, 1
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
love.graphics.rectangle('line', margin, margin, panel_width, panel_height, 5,5)
end
on.draw = function()
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local num_panels_hor, num_panels_ver = 3, 1
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
love.graphics.rectangle('line', margin, margin, panel_width, App.screen.height-margin*2, 5,5)
end
on.draw = function()
App.color{r=0.5,g=0.5,b=0.5}
local margin=15
local num_panels = 3
local panel_width = (App.screen.width - margin * (num_panels+1)) / num_panels
love.graphics.rectangle('line', margin, margin, (App.screen.width-margin*4)/3, App.screen.height-margin*2, 5,5)
end
![screenshot](assets/bf.gif)
Example program for trying out [driver.love](https://git.sr.ht/~akkartik/driver.love),
a programming environment for modifying programs live, without restarting
them.
local margin=15
local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_hor
local panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_ver
local x,y = 0, 0
for i = 1,num_panels_hor do
y = 0
for j = 1,num_panels_ver do
love.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)
y = y + margin + panel_height
end
x = x + margin + panel_width
end
draw_editor_panel(In)
draw_editor_panel(Code)
draw_editor_panel(Out)
draw_data(Data)
This file contains no definition, but is used as a marker in the save dir to
indicate all definitions have been copied from the repo to the save dir.
This file contains no definition, but is used as a marker in the save dir to indicate all definitions have been copied from the repo to the save dir.