Rock Paper Scissors

Rock Paper Scissors
javascript-memes, bad-code-memes, rock-paper-scissors-memes, string-concatenation-memes, code-smell-memes | ProgrammerHumor.io

Someone really looked at Rock Paper Scissors and thought "yeah, I can solve this with string concatenation." The genius move here is adding the computer's choice (1, 2, or 3) to the player's choice (also 1, 2, or 3) and checking if the result equals specific strings like "11", "22", "33" for draws, or "12" for rock vs paper. The problem? They're concatenating numbers as strings instead of doing actual math. So when computer picks 1 and player picks 2, you get "12" (the string), not 3 (the number). It's technically functional but hilariously cursed. It's like using a sledgehammer to crack an egg - sure it works, but everyone watching is uncomfortable. The real kicker is they're treating what should be simple arithmetic logic (winner = (player - computer + 3) % 3) like some kind of bizarre string matching puzzle. Props for creativity, but my code reviewer would have questions.

More Like This