You are viewing a single comment's thread. Return to all comments →
static string catAndMouse(int x, int y, int z) { var catADistanceToMouse = Math.Abs(x - z); var catBDistanceToMouse = Math.Abs(y - z);
if (catADistanceToMouse == catBDistanceToMouse) { return "Mouse C"; } else if (catADistanceToMouse < catBDistanceToMouse) { return "Cat A"; } return "Cat B";
}
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 →
static string catAndMouse(int x, int y, int z) { var catADistanceToMouse = Math.Abs(x - z); var catBDistanceToMouse = Math.Abs(y - z);
}