Darts

avatar

export const score = (x,y) => {

let radius = Math.sqrt(x*x+y*y);

if (radius <= 1) return 10;

else if (radius > 1 && radius <= 5) return 5;

else if (radius > 5 && radius <= 10) return 1;

else return 0;

};



0
0
0.000
4 comments
avatar

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

0
0
0.000
avatar

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

0
0
0.000