Posted 14 October 2012 - 09:14 PM
I've written a clock program, but it simply won't work! The code is:
while true do
sleep(0.1)
if math.floor(os.time())==0 or math.floor(os.time())==12 then
c = 1
end
if math.floor(os.time())==1 or math.floor(os.time())==13 then
c = 2
end
if math.floor(os.time())==2 or math.floor(os.time())==14 then
c = 4
end
if math.floor(os.time())==3 or math.floor(os.time())==15 then
c = 8
end
if math.floor(os.time())==4 or math.floor(os.time())==16 then
c = 16
end
if math.floor(os.time())==5 or math.floor(os.time())==17 then
c = 32
end
if math.floor(os.time())==6 or math.floor(os.time())==18 then
c = 64
end
if math.floor(os.time())==7 or math.floor(os.time())==19 then
c = 128
end
if math.floor(os.time())==8 or math.floor(os.time())==20 then
c = 256
end
if math.floor(os.time())==9 or math.floor(os.time())==21 then
c = 512
end
if math.floor(os.time())==10 or math.floor(os.time())==22 then
c = 1024
end
if math.floor(os.time())==11 or math.floor(os.time())==23 then
c = 2048
end
rs.setBundledOutput("top", c)
end
and when I run it it outputs
bios:206: [string "clock"]:8: 'end' expected (to close 'while' at line 1)
Could I get answers as soon as I can? Thanks for any replies!