You are viewing a single comment's thread. Return to all comments →
easy JS solution
function catAndMouse(x, y, z) { let a_dis=Math.abs(x-z), b_dis=Math.abs(y-z) if(a_dis<b_dis) return 'Cat A' else if(a_dis>b_dis) return 'Cat B' else return 'Mouse C' }
Seems like cookies are disabled on this browser, please enable them to open this website
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
easy JS solution