Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c = require("component")
- t = require("term")
- shell = require("shell")
- text = require("text")
- todoList = {"Enter anything to add it to the list", "1. Finish TODO List"}
- --functions
- function getInput()
- userInput = text.trim(t.read())
- if userInput == "exit" then
- os.reboot()
- end
- table.insert(todoList, userInput)
- end
- function updateScreen()
- term.clear()
- for i,v in ipairs(todoList) do
- print(tostring(i) .. ". " .. tostring(v))
- end
- end
- --Main Code Block
- while true do
- updateScreen()
- getInput()
- end
Advertisement
Add Comment
Please, Sign In to add comment