It is currently Mon Oct 20, 2014 5:48 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Sep 07, 2011 2:23 pm 
Offline
 Profile

Joined: Sun May 02, 2010 2:07 pm
Posts: 42
Many years ago I saw a program that had a display of the current time/date that updated itself every second. I couldn't understand how the code worked, but I do remember there was no assembler involved.

I have the code for the BBC's own VTR clock, which is just a repeat until loop that finishes whenever 1 second passes.

Given its common to have a countdown timer etc in some games, what alternative code exists out there ? Google is being stupid as per normal.


Top
 
PostPosted: Wed Sep 07, 2011 2:49 pm 
Offline
 Profile

Joined: Sat Sep 04, 2010 5:28 pm
Posts: 92
There's the TIME pseudo variable which is updated every 100th of a second, so to do a seconds clock you can just do:
Code:
TIME=0:REPEAT:REPEAT UNTIL TIME MOD 100=0:PRINT TIME DIV 100:UNTIL 0

Which'll give you a counter that updates each second.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron