Re: The Euphoria Sub Commander project

new topic     » goto parent     » topic index » view thread      » older message » newer message

Could someone please explain the following code to me in detail? I'm especially
confused by the
{} brackets.

k=player --1 or 2
cen={{120,360},{520,360}},     -- centers of clock
r=100,     -- radius of clock
rt=remaining time in secs



Don Cole
 
function p2xy(atom r, atom a)   -- polar to xy
   return {-r*sin(a),-r*cos(a)}
end function

draw_line(colors[k],{cen[[k],cen[k]+p2xy(r,rt/1800*PI)})



This code comes from       : Simple Chess Clock / Countdown Timer
                             Author     : Ernest Cheam  
                             
                             
In the Archives.

Thank you,

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu