ZAOOBVQ37BL2LABIRZ6PPX5QFZNAFWS4WU3Z6OX7J4E725FIPLSAC
learn_keychord_press = function(chord, key)
if chord == 'return' then
if Answer_idx > #Words then
-- no words yet; do nothing
elseif trim(Workbook.lines[1].data) == trim(Words[Answer_idx].contents) then
print('correct!')
Workbook.lines[1].data = ''
Workbook.cursor1 = {line=1, pos=1}
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
play(Answer_idx)
else
print(':(')
end
else
edit.keychord_press(Workbook, chord, key)
end
end
{"draw_new_word_button":117,"learn_mouse_press":219,"draw_recording_button":133,"draw_playing_button":130,"learn_text_input":222,"learn_key_release":223,"on.mouse_release":52,"play":235,"on.keychord_press":194,"file_exists":176,"draw_record_button":140,"draw_play_button":141,"Cursor_word":24,"Playing_source":126,"on.text_input":54,"learn_keychord_press":237,"on_new_word_button":118,"on.save_settings":200,"new_word":225,"on.key_release":55,"Recording_device":132,"on_word":80,"on":1,"on.mouse_press":51,"to_word_idx":94,"learn_mouse_release":220,"Words":12,"Workbook":198,"record":189,"Answer_idx":206,"on.initialize":202,"save_wav":171,"draw_teach_word":68,"learn_initialize":236,"exists":175,"on_play":96,"Mode":199,"teach_mouse_press":88,"draw_teach_screen":110,"teach_mouse_release":46,"draw_learn_screen":210,"teach_keychord_press":47,"on.draw":5,"teach_key_release":56,"fw_parent":236,"teach_text_input":49,"fw_app":"spell-cards","on_record":95,"Font_height":8,"on.load_settings":232,"Line_height":9,"Recording_word":138}
learn_initialize = function()
Workbook = edit.initialize_state(
50, -- top
20 + 50, App.screen.width-50,
Font_height, Line_height)
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
if Answer_idx then
play(Answer_idx)
end
end
{"Font_height":8,"Line_height":9,"on_new_word_button":118,"file_exists":176,"new_word":225,"save_wav":171,"on_word":80,"to_word_idx":94,"record":189,"fw_app":"spell-cards","draw_teach_word":68,"on_play":96,"on_record":95,"Cursor_word":24,"teach_mouse_release":46,"on.draw":5,"teach_keychord_press":47,"Words":12,"teach_key_release":56,"on.save_settings":200,"teach_text_input":49,"teach_mouse_press":88,"Recording_device":132,"on.load_settings":232,"learn_initialize":236,"fw_parent":235,"Recording_word":138,"draw_new_word_button":117,"draw_teach_screen":110,"Workbook":198,"draw_learn_screen":210,"draw_recording_button":133,"on":1,"draw_playing_button":130,"exists":175,"learn_text_input":222,"play":235,"learn_key_release":223,"on.initialize":202,"Answer_idx":206,"Mode":199,"learn_mouse_release":220,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"learn_mouse_press":219,"on.key_release":55,"learn_keychord_press":231,"on.text_input":54,"Playing_source":126}
play = function(word_idx)
if word_idx > #Words then return end
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif file_exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.wav')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"teach_key_release":56,"play":235,"on.draw":5,"Words":12,"on.initialize":202,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"on.save_settings":200,"draw_new_word_button":117,"learn_text_input":222,"on.load_settings":232,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"on.text_input":54,"teach_keychord_press":47,"Cursor_word":24,"learn_keychord_press":231,"on_play":96,"on_new_word_button":118,"on_record":95,"new_word":225,"Playing_source":126,"Workbook":198,"on_word":80,"exists":175,"save_wav":171,"to_word_idx":94,"on":1,"Recording_device":132,"draw_learn_screen":210,"record":189,"draw_teach_screen":110,"teach_text_input":49,"file_exists":176,"draw_teach_word":68,"Recording_word":138,"fw_parent":234,"learn_initialize":234,"fw_app":"spell-cards","teach_mouse_press":88,"learn_key_release":223,"teach_mouse_release":46,"Answer_idx":206,"Mode":199}
learn_initialize = function()
Workbook = edit.initialize_state(
50, -- top
20 + 50, App.screen.width-50,
Font_height, Line_height)
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
print(Answer_idx)
if Answer_idx then
play(Answer_idx)
end
end
{"teach_key_release":56,"teach_text_input":49,"play":197,"on.save_settings":200,"fw_parent":233,"draw_new_word_button":117,"on.load_settings":232,"learn_mouse_press":219,"draw_recording_button":133,"draw_playing_button":130,"Workbook":198,"learn_text_input":222,"learn_key_release":223,"learn_initialize":234,"on.mouse_press":51,"draw_record_button":140,"Answer_idx":206,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"teach_mouse_release":46,"on.text_input":54,"learn_mouse_release":220,"Playing_source":126,"on":1,"Cursor_word":24,"on_new_word_button":118,"on.mouse_release":52,"new_word":225,"Recording_word":138,"Recording_device":132,"on_word":80,"fw_app":"spell-cards","Font_height":8,"save_wav":171,"Mode":199,"file_exists":176,"draw_teach_screen":110,"record":189,"draw_learn_screen":210,"to_word_idx":94,"on.draw":5,"draw_teach_word":68,"Words":12,"exists":175,"on.initialize":202,"teach_mouse_press":88,"on_record":95,"on_play":96,"Line_height":9,"learn_keychord_press":231,"teach_keychord_press":47}
learn_initialize = function()
Workbook = edit.initialize_state(
50, -- top
20 + 50, App.screen.width-50,
Font_height, Line_height)
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
if Answer_idx then
play(Answer_idx)
end
end
{"new_word":225,"play":197,"on_word":80,"to_word_idx":94,"record":189,"file_exists":176,"draw_teach_word":68,"on_play":96,"save_wav":171,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":232,"Mode":199,"learn_keychord_press":231,"draw_teach_screen":110,"teach_keychord_press":47,"exists":175,"draw_recording_button":133,"on.draw":5,"teach_text_input":49,"Words":12,"Workbook":198,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"Playing_source":126,"Answer_idx":206,"draw_playing_button":130,"on_record":95,"learn_text_input":222,"teach_key_release":56,"learn_key_release":223,"Recording_device":132,"on.load_settings":232,"fw_app":"spell-cards","Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"on.save_settings":200,"on.key_release":55,"draw_learn_screen":210,"on.text_input":54,"learn_initialize":233,"Cursor_word":24,"on":1,"learn_mouse_release":220,"on_new_word_button":118}
on.load_settings = function(settings)
if settings == nil then return end
Font_height = settings.font_height
Line_height = settings.line_height
for _,w in ipairs(settings.words) do
new_word()
Cursor_word.contents = w
Cursor_word.lines[1].data = w
Text.redraw_all(Cursor_word)
end
Cursor_word = nil
end
{"draw_teach_word":68,"draw_new_word_button":117,"teach_mouse_press":88,"teach_mouse_release":46,"draw_playing_button":130,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":202,"draw_learn_screen":210,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"Playing_source":126,"learn_keychord_press":231,"exists":175,"learn_text_input":222,"draw_teach_screen":110,"learn_key_release":223,"on_new_word_button":118,"on.save_settings":200,"file_exists":176,"on.text_input":54,"Recording_device":132,"on_word":80,"on.mouse_release":52,"draw_play_button":141,"to_word_idx":94,"Mode":199,"on.key_release":55,"Recording_word":138,"record":189,"on_play":96,"Cursor_word":24,"fw_parent":231,"on.keychord_press":194,"fw_app":"spell-cards","draw_record_button":140,"new_word":225,"on":1,"on_record":95,"Answer_idx":206,"save_wav":171,"play":197,"Workbook":198,"learn_initialize":224,"draw_recording_button":133,"teach_keychord_press":47,"on.load_settings":232,"on.mouse_press":51}