Alternative approach to the Rock-Paper-Scissors-Lizard-Spock problem

This is the solution I designed for the Rock-Paper-Scissors-Lizard-Spock challenge posted in C++ Learn course. I think it may be of interest, since I adopted a peculiar approach when it comes to determine the winner. There is a clear common pattern for computing the result as long as the list of shapes is properly ordered, thus I exploited this sequence to avoid a long list of conditionals. I hope it will provide a different way of approaching the task and it will trigger other brilliant minds’ ideas. Do not hesitate to share your viewpoint or provide alternatives.

—> Go to the repositoy

1 Like