Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("right")
- monitor.clear()
- local function screenRefresh()
- monitor.clear()
- monitor.setCursorPos(1,1)
- local x, y = term.getCursorPos()
- monitor.write(" THE GRAND TODO LIST!")
- y=y+1
- monitor.setCursorPos(x,y)
- for i = 1,#Table do
- monitor.write("Table[i]")
- monitor.setCursorPos(x,y)
- y=y+1
- end
- end
- local Table = {}
- print(#Table)
- local input = ""
- local numin = 0
- local taskin = ""
- while true do
- print("What would you like to do?")
- print("1) Add new item.")
- print("2) Remove item.")
- print("3) Refresh List.")
- input = read()
- if (input == "1") and (#Table < 15) then
- print("New Item:")
- taskin = read()
- table.insert(Table, taskin)
- print(#Table)
- -- screenRefresh()
- elseif #Table > 15 then
- print("Sorry, the list is full!")
- end
- if (input == "2") then
- print("Which item should I remove?")
- numin = tonumber(read())
- table.remove(Table, numin)
- screenRefresh()
- end
- if (input == "3") then
- screenRefresh()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment