option angle=degrees external long function plot_init, plot_batch_start, plot_batch_end declare word timarr(1 to 7) dim timbuf%(1 to 2) radius% = 51 xcentre% = 80 ycentre% = 37 print esc; "[2J"; esc; "[H"; z% = plot_init exit program z% unless z% and 1% z% = plot_batch_start exit program z% unless z% and 1% ox% = xcentre% oy% = ycentre% - radius% * 2% / 3% for n% = 0 to 360% x% = xcentre% + sin(n%) * radius% y% = ycentre% - cos(n%) * radius% * 2% / 3% call draw(ox%, oy%, x%, y%) ox% = x% oy% = y% next n% for n% = 1 to 12 x1% = xcentre% + sin(n% * 30%) * radius% * 8% / 10% y1% = ycentre% - cos(n% * 30%) * radius% * 8% / 10% * 2% / 3% x2% = xcentre% + sin(n% * 30%) * radius% * 9% / 10% y2% = ycentre% - cos(n% * 30%) * radius% * 9% / 10% * 2% / 3% call draw(x1%, y1%, x2%, y2%) next n% for n% = 1 to 60 x% = xcentre% + sin(n% * 6%) * radius% * 9% / 10% y% = ycentre% - cos(n% * 6%) * radius% * 9% / 10% * 2% / 3% call plot(x%, y%) next n% print esc; "[H"; while -1% call SYS$GETTIM(timbuf(1%)) call SYS$NUMTIM(timarr(1%), timbuf(1%)) h% = timarr(4%) m% = timarr(5%) s% = timarr(6%) hx% = xcentre% + sin(h% * 30% + m% / 2%) * radius% * 5% / 10% hy% = ycentre% - cos(h% * 30% + m% / 2%) * radius% * 5% / 10% * 2% / 3% mx% = xcentre% + sin(m% * 6% + s% / 10%) * radius% * 7% / 10% my% = ycentre% - cos(m% * 6% + s% / 10%) * radius% * 7% / 10% * 2% / 3% sx1% = xcentre% + sin(s% * 6%) * radius% * 2% / 10% sy1% = ycentre% - cos(s% * 6%) * radius% * 2% / 10% * 2% / 3% sx2% = xcentre% + sin(s% * 6%) * radius% * 7% / 10% sy2% = ycentre% - cos(s% * 6%) * radius% * 7% / 10% * 2% / 3% call draw(xcentre%, ycentre%, hx%, hy%) call draw(xcentre%, ycentre%, mx%, my%) call draw(sx1%, sy1%, sx2%, sy2%) z% = plot_batch_end exit program z% unless z% and 1% sleep 1% z% = plot_batch_start exit program z% unless z% and 1% call undraw(xcentre%, ycentre%, hx%, hy%) call undraw(xcentre%, ycentre%, mx%, my%) call undraw(sx1%, sy1%, sx2%, sy2%) next