Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ToDoList
- -- MrKarp 4/1/2016 "April Fools"
- -- Pop on and off items in a table to represent a editable todo list
- monitor = peripheral.wrap("back")
- Table = {}
- itemNum = 0
- function ClearMon()
- monitor.clear()
- end
- function GetInput()
- write("Enter Item: ")
- input = read()
- table.insert(Table, input)
- itemNum = itemNum + 1
- --monitor.write(itemNUm..": "..input)
- end
- function ClearItem()
- monitor.write("Delete Which Item #?: ")
- delInput = read()
- table.delete(Table, delInput)
- end
- function Display()
- monitor.setCursorPos(1,1)
- for i=0, #Table do
- monitor.write(Table[i])
- monitor.setCursorPos(1,i)
- end
- end
- function Choice()
- write("1.Add 2.Delete: ")
- choice = read()
- if(choice=="1") then
- GetInput()
- end
- if(choice=="2") then
- ClearItem()
- end
- ClearMon()
- Display()
- end
- while true do
- Choice()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement