Rock, Paper, Scissors is fixed.

This commit is contained in:
Storm Dragon 2016-09-03 10:25:55 -04:00
parent 0178eb057f
commit 4e6a3c0dd1

View File

@ -16,19 +16,19 @@ case "${player^^}" in
player="INVALID" player="INVALID"
esac esac
if [ "$player" = "INVALID" ]; then if [[ "$player" = "INVALID" ]]; then
msg "$2" "$1: Please select PAPER, ROCK, or SCISSORS." 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." msg "$2" "$1: You and I both selected $player, so we tied."
elif [ "$cpu" = "PAPER" && "$player" != "SCISSORS" ]; then elif [[ "$cpu" = "PAPER" && "$player" != "SCISSORS" ]]; then
msg "$2" "$1: my $CPU beats your $player!" msg "$2" "$1: my $cpu beats your $player!"
elif [ "$cpu" = "ROCK" && "$player" != "PAPER" ]; then elif [[ "$cpu" = "ROCK" && "$player" != "PAPER" ]]; then
msg "$2" "$1: my $CPU beats your $player!" msg "$2" "$1: my $cpu beats your $player!"
elif [ "$cpu" = "SCISSORS" && "$player" != "ROCK" ]; then elif [[ "$cpu" = "SCISSORS" && "$player" != "ROCK" ]]; then
msg "$2" "$1: my $CPU beats your $player!" msg "$2" "$1: my $cpu beats your $player!"
elif [ "$player" = "PAPER" && "$cpu" != "SCISSORS" ]; then elif [[ "$player" = "PAPER" && "$cpu" != "SCISSORS" ]]; then
msg "$2" "$1: your $player beats my $cpu!" 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!" msg "$2" "$1: your $player beats my $cpu!"
else else
msg "$2" "$1: your $player beats my $cpu!" msg "$2" "$1: your $player beats my $cpu!"