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 dotable.insert(Data, 0)endOut = 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 thenCursor = Inedit.mouse_press(Cursor, x,y, mouse_button)elseif x < Code.right thenif y < App.screen.height/2 thenCursor = Codeedit.mouse_press(Cursor, x,y, mouse_button)elseCursor = DataendelseCursor = Outedit.mouse_press(Cursor, x,y, mouse_button)endend
{"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,1while cp <= #code doprint('== inst', cp, #code)print('-- data')for i,d in ipairs(Data) doprint(i,d)endlocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 thendata[dp] = string.byte(In.editor.lines[1].data:sub(1,1))elsedata[dp] = 0endIn.editor.lines[1].data = In.editor.lines[1].data:sub(2)elseif inst == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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 thenCursor = Inelseif x < Code.right thenif y < App.screen.height/2 thenCursor = CodeelseCursor = DataendelseCursor = Outendedit.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 halflocal 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 + Marginlocal y = Margin + panel_height + Marginy = draw_title(Data_title_text, left, top, panel_width)x = x + 20for i,d in ipairs(data) doApp.color{r=0.5,g=0.5,b=0.5}local mode = 'line'if i == data.p thenmode = 'fill'endlove.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
on.mouse_press = function(x,y, mouse_button)if x < In.editor.right thenCursor = Inedit.mouse_press(Cursor, x,y, mouse_button)elseif x < Code.editor.right thenif y < App.screen.height/2 thenCursor = Codeedit.mouse_press(Cursor, x,y, mouse_button)elseCursor = DataendelseCursor = Outedit.mouse_press(Cursor, x,y, mouse_button)endend
eval = function(code, data)local cp,dp = 1,1while cp <= #code doprint('== inst', cp, #code)print('-- data')for i,d in ipairs(Data) doprint(i,d)endlocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenprint('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 thendata[dp] = string.byte(In.editor.lines[1].data:sub(1,1))elsedata[dp] = 0endIn.editor.lines[1].data = In.editor.lines[1].data:sub(2)elseif inst == '#' thencp = code:find('\n', cp)endcp = cp+1endend
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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_horizontallocal left = (col - 1) * (Margin + panel_width) + Marginlocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]local top = (row - 1) * (Margin + panel_height) + Marginlocal 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 resultend
{"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,1while cp <= #code doprint('== inst', cp, #code)print('-- data')for i,d in ipairs(Data) doprint(i,d)endlocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenprint('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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20print(x,y, App.screen.width, App.screen.height, #data)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
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.pwhile cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 thendata[dp] = string.byte(In.editor.lines[1].data:sub(1,1))elsedata[dp] = 0endIn.editor.lines[1].data = In.editor.lines[1].data:sub(2)elseif inst == '#' thencp = code:find('\n', cp)endcp = cp+1enddata.p = dpend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20print(x,y, App.screen.width, App.screen.height, #data)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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,1while cp <= #code doprint('== inst', cp, #code)local inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenprint('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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
draw_data = function(data)-- assume data is in middle column, bottom halflocal 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 + Marginlocal y = Margin + panel_height + Marginy = draw_title(Data_title_text, left, top, panel_width)x = x + 20for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 5local y = Margin + panel_height + Margin + 5print(x,y, App.screen.width, App.screen.height, #data)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 5endendend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginprint(x,y, App.screen.width, App.screen.height, #data)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Marginendendend
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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginy = draw_title(Data_title_text, left, top, panel_width)x = x + 20for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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,1while cp <= #code doprint('== inst', cp)local inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenprint('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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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 dotable.insert(Data, 0)endData[1] = 3Data[2] = 4Data_title_text = App.newText(Title_font, 'Data')end
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginprint(x,y, App.screen.width, App.screen.height, #data)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Marginendend
{"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 dotable.insert(Data, 0)endOut = 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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginy = draw_title(Data_title_text, x,y, panel_width)x = x + 20for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenprint('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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginprint(x,y, App.screen.width, App.screen.height, #data)for i,d in ipairs(data) doApp.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+80endend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Marginy = draw_title(Data_title_text, x,y, panel_width)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginprint(x,y, App.screen.width, App.screen.height)for i,d in ipairs(data) doApp.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+80endend
{"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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginprint(x,y)for i,d in ipairs(data) doApp.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+80endend
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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginy = draw_title(Data_title_text, x,y, panel_width)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginfor i,d in ipairs(data) doApp.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+80endend
{"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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20y = draw_title(Data_title_text, x,y, panel_width)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Marginlocal y = Margin + panel_height + Marginfor i,d in ipairs(data) doendend
{"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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)y = y + Margin + panel_heightendx = x + Margin + panel_widthendedit.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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20y = draw_title(Data_title_text, x,y, panel_width)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)y = y + Margin + panel_heightendx = x + Margin + panel_widthendedit.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_horizontallocal left = (col - 1) * (Margin + panel_width) + Marginlocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]local top = (row - 1) * (Margin + panel_height) + Marginlocal 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 resultend
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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)y = y + Margin + panel_heightendx = x + Margin + panel_widthendedit.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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' thenOut.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 == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+Margin, y+Margin, panel_width, panel_height, 5,5)y = y + Margin + panel_heightendx = x + Margin + panel_widthendedit.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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+Margin, y+margin, panel_width, panel_height, 5,5)y = y + Margin + panel_heightendx = x + Margin + panel_widthendedit.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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[' , cp, --[[plain]] true)endelseif inst == '.' then--print(string.char(data[dp]))print(data[dp])elseif inst == ',' thendata[dp] = string.byte(io.read(1))elseif inst == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+Margin, y+margin, panel_width, panel_height, 5,5)y = y + Margin + panel_heightendx = x + Margin + panel_widthendedit.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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20y = draw_title(Data_title_text, x,y, panel_width)for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
eval = function(code, data)local cp,dp = 1,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp, --[[plain]] true)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[', cp)endelseif inst == '.' then--print(string.char(data[dp]))print(data[dp])elseif inst == ',' thendata[dp] = string.byte(io.read(1))elseif inst == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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_horizontallocal x = 0for i = 1,Num_panels_horizontal dolocal panel_height = (App.screen.height - margin * (Num_panels_vertical[i]+1)) / Num_panels_vertical[i]local y = 0for j = 1,Num_panels_vertical[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendedit.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,panelyApp.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 + 100end
{"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,panelyApp.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_horizontallocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendedit.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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20y = y + 100for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
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_horizontallocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendedit.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,1while cp <= #code dolocal inst = code:sub(cp,cp)if inst == '<' thendp = dp-1elseif inst == '>' thendp = dp+1elseif inst == '+' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]+1elseif inst == '-' thenif data[dp] == nil then data[dp] = 0 enddata[dp] = data[dp]-1elseif inst == '[' thenif data[dp] == 0 thencp = code:find(']', cp)endelseif inst == ']' thenif data[dp] ~= 0 thencp = rfind(code, '[', cp)endelseif inst == '.' then--print(string.char(data[dp]))print(data[dp])elseif inst == ',' thendata[dp] = string.byte(io.read(1))elseif inst == '#' thencp = code:find('\n', cp)endcp = cp+1endend
{"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_horizontallocal left = (col - 1) * (Margin + panel_width) + Marginlocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]local top = (row - 1) * (Margin + panel_height) + Marginlocal result = edit.initialize_state(top, left, left+panel_width, Font_size, math.floor(Font_size*1.3))Text.redraw_all(result)return resultend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20App.color{r=0.7,g=0.7,b=0.7}y = y + 100for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendendlove.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_horizontallocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20App.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 + 30for i,d in ipairs(data) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20App.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) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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_horizontallocal left = (col - 1) * (Margin + panel_width) + Marginlocal panel_height = (App.screen.height - Margin * (Num_panels_vertical[col]+1)) / Num_panels_vertical[col]local top = (row - 1) * (Margin + panel_height) + Marginreturn 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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20App.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) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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 halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20App.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) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
{"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 panelslocal num_panels_hor = 3local num_panels_ver = {1,2,1} -- number of vertical panels by columnassert(#num_panels_ver == num_panels_hor)App.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
draw_data = function(data)-- assumes data is in middle column, bottom halflocal panel_width = (App.screen.width - Margin * (Num_panels_horizontal+1)) / Num_panels_horizontallocal panel_height = (App.screen.height - Margin*3) / 2local x = Margin + panel_width + Margin + 20local y = Margin + panel_height + Margin + 20App.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) doApp.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+80if i%5 == 0 theny = y + 40x = Margin + panel_width + Margin + 20endendend
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 dotable.insert(Data, 0)endData[1] = 3Data[2] = 4Out = 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 panelslocal num_panels_hor = 3local num_panels_ver = {3,4,1} -- number of vertical panels by columnassert(#num_panels_ver == num_panels_hor)App.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
{"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 panelslocal num_panels_hor = 3local num_panels_ver = {3,4,1} -- number of vertical panels by columnassert(#num_panels_ver == num_panels_hor)App.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
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 dotable.insert(Data, 0)enddata[1] = 3data[2] = 4Out = 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 panelslocal num_panels_hor = 3local num_panels_ver = {1,2,1} -- number of vertical panels by columnassert(#num_panels_ver == num_panels_hor)App.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver[i] dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
{"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 panelslocal num_panels_hor = 3local num_panels_ver = {1,2,1} -- number of vertical panels by columnassert(#num_panels_ver == num_panels_hor)App.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal x = 0for i = 1,num_panels_hor dolocal panel_height = (App.screen.height - margin * (num_panels_ver[i]+1)) / num_panels_ver[i]local y = 0for j = 1,num_panels_ver dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
{"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 panelslocal num_panels_hor, num_panels_ver = 3, 1 -- vary thisApp.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_hor doy = 0for j = 1,num_panels_ver dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
{"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 panelslocal num_panels_hor, num_panels_ver = 3, 6 -- vary thisApp.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_hor doy = 0for j = 1,num_panels_ver dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthendend
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 dotable.insert(Data, 0)enddata[1] = 3data[2] = 4Out = 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 dotable.insert(Data, 0)enddata[1] = 3data[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 dotable.insert(Data, 0)endData[1] = 3Out = create_editor(3, 1)end
on.draw = function()-- draw a grid of equally-sized panelslocal num_panels_hor, num_panels_ver = 3, 1 -- vary thisApp.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_ver dox = 0for j = 1,num_panels_hor dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)x = x + margin + panel_widthendy = y + margin + panel_heightendend
{"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 dotable.insert(Data, 0)endtable[1] = 3Out = create_editor(3, 1)end
on.draw = function()-- draw a grid of equally-sized panelslocal num_panels_hor, num_panels_ver = 5, 2 -- vary thisApp.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_ver dox = 0for j = 1,num_panels_hor dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)x = x + margin + panel_widthendy = y + margin + panel_heightendend
{"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 panelslocal num_panels_hor, num_panels_ver = 3, 2 -- vary thisApp.color{r=0.5,g=0.5,b=0.5}local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_ver dox = 0for j = 1,num_panels_hor dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)x = x + margin + panel_widthendy = y + margin + panel_heightendend
on.draw = function()App.color{r=0.5,g=0.5,b=0.5}local margin=15local num_panels_hor, num_panels_ver = 3, 1local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_ver dox = 0for j = 1,num_panels_hor dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)x = x + margin + panel_widthendy = y + margin + panel_heightendend
on.draw = function()App.color{r=0.5,g=0.5,b=0.5}local margin=15local num_panels_hor, num_panels_ver = 3, 1local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i in 1,num_panels_ver dox = 0for j in 1,num_panels_hor dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)x = x + margin + panel_widthendy = y + margin + panel_heightendend
on.draw = function()App.color{r=0.5,g=0.5,b=0.5}local margin=15local num_panels_hor, num_panels_ver = 3, 1local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlove.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=15local num_panels_hor, num_panels_ver = 3, 1local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlove.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=15local num_panels = 3local panel_width = (App.screen.width - margin * (num_panels+1)) / num_panelslove.graphics.rectangle('line', margin, margin, (App.screen.width-margin*4)/3, App.screen.height-margin*2, 5,5)end
Example program for trying out [driver.love](https://git.sr.ht/~akkartik/driver.love),a programming environment for modifying programs live, without restartingthem.
local margin=15local panel_width = (App.screen.width - margin * (num_panels_hor+1)) / num_panels_horlocal panel_height = (App.screen.height - margin * (num_panels_ver+1)) / num_panels_verlocal x,y = 0, 0for i = 1,num_panels_hor doy = 0for j = 1,num_panels_ver dolove.graphics.rectangle('line', x+margin, y+margin, panel_width, panel_height, 5,5)y = y + margin + panel_heightendx = x + margin + panel_widthend
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 toindicate 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.