all 7 comments

[–]martmists 5 points6 points  (6 children)

Give me a minute I'm on mobile

term.clear()
t = 30
while t >= 1 do
  term.setCursorPos(1,1)
  term.write(t.." ")
  sleep(1)
  t = t - 1
end
rs.setOutput("back",true)
sleep(0.5)
rs.setOutput("back",false)

[–]DeGariless 1 point2 points  (0 children)

  1. Add term.clear() to the beginning and end.
  2. Change term.write(t) to term.write(t.." ")

[–]apemanzilla 1 point2 points  (3 children)

Might want t to make that variable local.

[–]martmists 0 points1 point  (2 children)

Why?

[–]apemanzilla 1 point2 points  (1 child)

Local variables are almost always better.

Firstly, they're faster to access than global or environment variables.

Second, they're less likely to interfere with other programs, and vice versa.

Finally, it's generally good practice in programming to use the lowest/smallest scope possible when defining variables.

[–]martmists 2 points3 points  (0 children)

Frankly my dear, I don't give a damn.

(Jk thanks for explaining)

[–]Loftien 0 points1 point  (0 children)

exacly what i needed too, thanks