FOIVD5LONOOAGGFG3M4AT5KLVOB7WILZ4WH26BH7FOFPGXVPTLUQC
on.mouse_release = function(x,y, mouse_button)
if Cursor then
edit.mouse_release(Cursor.editor, x,y, mouse_button)
end
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,"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}
on.keychord_press = function(chord, key)
if chord == 'f4' then
eval(editor_to_string(Code.editor), Data)
elseif Cursor then
edit.keychord_press(Cursor.editor, chord, key)
end
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}
on.key_release = function(key, scancode)
if Cursor then
edit.key_release(Cursor.editor, key, scancode)
end
end
{"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}
{"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}
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
if i == data.p then
App.color{r=0.7,g=0.7,b=0.7}
love.graphics.rectangle('fill', x,y, 60, 30, 2,2)
else
App.color{r=0.5,g=0.5,b=0.5}
love.graphics.rectangle('line', x,y, 60, 30, 2,2)
end
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,"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}
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.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.p = 1 -- data pointer
Data_title_text = App.newText(Title_font, 'Data')
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":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}
{"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}
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_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}
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
{"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}
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
{"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}
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,"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}
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
{"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}
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
{"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}
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
{"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}
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