MOON
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
System: Linux vps.panamaemb.org.sg 3.10.0-1160.80.1.vz7.191.4 #1 SMP Thu Dec 15 20:31:06 MSK 2022 x86_64
User: panama (500)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //usr/share/doc/bash-3.2/scripts/randomcard.bash
# The following prints a random card from a card deck.
#
# cribbed from the ksh93 book, example from page 70
#
# chet@po.cwru.edu
#
declare -i i=0

# load the deck
for suit in clubs diamonds hearts spades; do
	for n in ace 2 3 4 5 6 7 8 9 10 jack queen king; do
		card[i]="$n of $suit"
        	i=i+1		# let is not required with integer variables
	done
done

# and print a random card
echo ${card[RANDOM%52]}