A clock Marcus Administrator Posts: 579 Threads: 76 Joined: Jan 2018 Reputation: 16 10-15-2022, 03:50 PM i don't know when I wrote this ... found it in a folder. Code:```set window "Clock", 400, 400, 0, 0 set redraw off do     t = datetime()     set color 128, 128, 128     cls     set color 0, 0, 0     rx = width(primary)/2     ry = height(primary)/2     draw ellipse rx, ry, rx, ry, true     set color 255, 255, 255     draw ellipse rx, ry, rx - 4, ry - 4, true     set color 200, 0, 0         a = rad(360*t.second/60 - 90)     DrawThickLine(rx, ry, rx + cos(a)*(rx*0.9 - 4), ry + sin(a)*(ry*0.9 - 4), 4)         set color 0, 0, 0     a = rad(360*t.minute/60 - 90)     DrawArrow(rx, ry, rx + cos(a)*(rx*0.8 - 4), ry + sin(a)*(ry*0.8 - 4), 12)         a = rad(360*(t.hour%12)/12 - 90)     DrawArrow(rx, ry, rx + cos(a)*(rx*0.6 - 4), ry + sin(a)*(ry*0.6 - 4), 16)         draw ellipse rx, ry, 8, 8, true         redraw     fwait 1 loop function DrawThickLine(x1, y1, x2, y2, thickness)     dx = x2 - x1     dy = y2 - y1     k = 0.5*thickness/sqr(dx*dx + dy*dy)     ddx = -dy*k     ddy = dx*k     p = [         round(x1 + ddx), round(y1 + ddy),         round(x2 + ddx), round(y2 + ddy),         round(x2 - ddx), round(y2 - ddy),         round(x1 - ddx), round(y1 - ddy)]     draw poly p, true endfunc function DrawArrow(x1, y1, x2, y2, thickness)     dx = x2 - x1     dy = y2 - y1     k = 0.5*thickness/sqr(dx*dx + dy*dy)     ddx = -dy*k     ddy = dx*k     p = [         x1, y1,         x1*0.25 + x2*0.75 - ddx, y1*0.25 + y2*0.75 - ddy,         x2, y2,         x1*0.25 + x2*0.75 + ddx, y1*0.25 + y2*0.75 + ddy]             draw poly p, true endfunc``` johnno1956 Senior Member Posts: 391 Threads: 58 Joined: Jun 2021 Reputation: 1 10-16-2022, 05:45 AM Cool... An analogue clock... I can remember, decades ago, a meme involving an analogue clock and a computer program... A young guy was boasting that he wrote a 'clock' program and was proud to show it off to his friends. The cartoon showed an image of a young guy with his computer monitor strapped to his wrist. Sorry. Your program brought back that particular memory... Never the less... a cool clock... May your journey be free of incident. Live long and prosper. « Next Oldest | Next Newest »