Log In  


Cart #picocoderclock-0 | 2025-06-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

A simple clock made in 290 characters. I decided to upload the cartridge and not just the gif of this postcart, because it would be pointless if you couldn't see the current time with it.

Source code:

s=sin
c=cos
t=stat
v=ovalfill
o=64.5function l(a,b)line(o,o,o-s(a)*b,o-c(a)*b)end::_::srand()cls(4)rectfill(8,8,119,119,2)v(0,0,127,127,4)v(8,8,119,119,7)for i=1,12do?i,-s(i/12)*48+62,-c(i/12)*48+61,0
end?"●",61,62
e=t(95)/60%1m=(e+t(94))/60%1h=(m+t(93))/12l(e,52)l(m,44)l(h,32)flip()goto _
2


1

Cool clock and readable code.
What was the self imposed char limit ?
There's a call to srand() at the start of the loop, what was the original intention ?


@RealShadowCaster, I commend you if this code is readable to you, since it apparently was so unreadable for me that I missed that pesky srand() XD Originally I was going to add some randomly placed gears in the background of the clock, but the character limit proved more challenging than I'd expected just to get the clock hands running, and I must've forgotten to remove srand(). In the end I settled for the colored corners you see in the final version. The character limitation was because this is meant to be a "postcart," as explained here: https://www.lexaloffle.com/bbs/?tid=145008 I've been trying to make some postcarts recently as a new method of procrastinating and putting off my main PICO-8 projects, which of course were also started to put off bigger projects in other engines XD


Wow! There is hardly any code! It would be great to have other clock themes!



[Please log in to post a comment]