From 4e6a3c0dd1dc73d9e4075803dae710daf52dcacb Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 3 Sep 2016 10:25:55 -0400 Subject: [PATCH] Rock, Paper, Scissors is fixed. --- modules/rps/rps.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/rps/rps.sh b/modules/rps/rps.sh index 7e58b45..694ca81 100755 --- a/modules/rps/rps.sh +++ b/modules/rps/rps.sh @@ -16,19 +16,19 @@ case "${player^^}" in player="INVALID" esac -if [ "$player" = "INVALID" ]; then +if [[ "$player" = "INVALID" ]]; then msg "$2" "$1: Please select PAPER, ROCK, or SCISSORS." -elif [ "$cpu" = "$player" ]; then +elif [[ "$cpu" = "$player" ]]; then msg "$2" "$1: You and I both selected $player, so we tied." -elif [ "$cpu" = "PAPER" && "$player" != "SCISSORS" ]; then - msg "$2" "$1: my $CPU beats your $player!" -elif [ "$cpu" = "ROCK" && "$player" != "PAPER" ]; then - msg "$2" "$1: my $CPU beats your $player!" -elif [ "$cpu" = "SCISSORS" && "$player" != "ROCK" ]; then - msg "$2" "$1: my $CPU beats your $player!" -elif [ "$player" = "PAPER" && "$cpu" != "SCISSORS" ]; then +elif [[ "$cpu" = "PAPER" && "$player" != "SCISSORS" ]]; then + msg "$2" "$1: my $cpu beats your $player!" +elif [[ "$cpu" = "ROCK" && "$player" != "PAPER" ]]; then + msg "$2" "$1: my $cpu beats your $player!" +elif [[ "$cpu" = "SCISSORS" && "$player" != "ROCK" ]]; then + msg "$2" "$1: my $cpu beats your $player!" +elif [[ "$player" = "PAPER" && "$cpu" != "SCISSORS" ]]; then msg "$2" "$1: your $player beats my $cpu!" -elif [ "$player" = "ROCK" && "$cpu" != "PAPER" ]; then +elif [[ "$player" = "ROCK" && "$cpu" != "PAPER" ]]; then msg "$2" "$1: your $player beats my $cpu!" else msg "$2" "$1: your $player beats my $cpu!"