Which do you prefer?

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 6 months ago* (last edited 5 months ago) (2 children)

This could be controversial, but...

if (target > (index + middle + ring)) { use(fist); }  
else if (target < (middle + ring)) { use(middle); }  
else if (target < (index + middle + ring)) { use(middle + ring); }  
else { use(index + middle + ring); }  

Of course, this doesn't cover error handling, such as rejection.

  • source
  • hideshow 2 child comments