Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local switch = "am"
- local hour = 10
- local min = 0
- local sec = 0
- --mon = peripheralWrap("back")
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Eatern Standard Time")
- sec = sec+1
- if sec>59 then
- sec = 0
- min = min+1
- end
- if min > 59 then
- min = 0
- hour = hour+1
- end
- if hour > 12 then
- if switch=="am" then
- switch = "pm"
- else
- switch = "am"
- end
- hour = 1
- end
- if min <10 and sec <10 then
- print(tostring(hour)..":0"..tostring(min)..":0"..tostring(sec).." "..switch)
- elseif min<10 and sec>=10 then
- print(tostring(hour)..":0"..tostring(min)..":"..tostring(sec).." "..switch)
- elseif sec < 10 then
- print(tostring(hour)..":"..tostring(min)..":0"..tostring(sec).." "..switch)
- else
- print(tostring(hour)..":"..tostring(min)..":"..tostring(sec).." "..switch)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement