Sha256: c5ae327f444ed0d811aabf941cd54a97255806826ef76dca2f55c1ae5d024654
Contents?: true
Size: 460 Bytes
Versions: 96
Compression:
Stored size: 460 Bytes
Contents
#!/usr/bin/env bash function usage() { echo "Usage: raindrops <number>" >&2 exit 1 } # check argument is present if [ ! "$#" -eq 1 ]; then usage fi # check param is an integer if ! [[ $1 =~ ^[0-9]+$ ]]; then usage fi output="" if [ $(($1 % 3)) -eq 0 ]; then output="Pling" fi if [ $(($1 % 5)) -eq 0 ]; then output=$output"Plang" fi if [ $(($1 % 7)) -eq 0 ]; then output=$output"Plong" fi if [ -z $output ]; then echo $1 else echo $output fi
Version data entries
96 entries across 96 versions & 1 rubygems