-- Source https://stackoverflow.com/a/11130774 function scandir(directory) local directory = directory or "" local i, t, popen = 0, {}, io.popen local pfile = popen('ls "'..directory..'"') for filename in pfile:lines() do i = i + 1 t[i] = filename end pfile:close() return t end function getFormattedLessonNames(directory) local t = scandir(directory) for i=1, #t do t[i] = colorTextBackground(COLOR.Black,"\n#" .. i .. " " .. colorText(COLOR.HighBlue,string.gsub(t[i],".lua",""))) end return t end function lesson(number) number = tonumber(number) local t = scandir(dir.."/heonian-content/lessons/") if t[number] then dofile("heonian-content/lessons/"..t[number]) else print("lesson not found") end end function lessonPause() print("\nInput anything to continue") io.read() print(scrollTerminalUp(4)) end