It depends on how complicated you want it to be. Since your game is text-based, i think is better just to post a hardcoded result instead of relying on the player's choiced in-battle. Something like: "You fighted that ugly spider, and you won!" But if you want it to be variable, then this algorithm can help you: