Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is part of a Computercraft Programming Teaching Program
- tSides = {"left","right","bottom","top","front","back"}
- for i = 1, #tSides do
- monitor = peripheral.wrap(tSides[i])
- if monitor then
- side = tSides[i]
- break
- end
- end
- --Prevents program termination
- os.pullEvent = os.pullEventRaw
- term.redirect(peripheral.wrap(side))
- -- Resets Screen
- function reset()
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- end
- reset()
- print("Section 3: Variables \n")
- print("a = \"test\" - Declares the variable \"a\" as a string with the text \"test\" ")
- print("a = 2 - Declares the variable \"a\" with a numerical value of 2")
- print("a = read() - makes whatever you type next the value of the variable \"a\"")
- print("print(a) - Prints the value of the variable \"a\"")
- term.restore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement