# deckShuffle

killvar 'deckFace'
killvar '$deckImg'

i = 0
:loop1
if i < 4:
	i += 1
	if i = 1: $text = 'Spades'
	if i = 2: $text = 'Hearts'
	if i = 3: $text = 'Clubs'
	if i = 4: $text = 'Diamonds'
	j = 0
	:loop2
	if j < 13:
		j += 1
		deckFace[] = j
		$deckImg[] = 'images/casino/cards/<<$text>>/<<j>>.png'
		jump 'loop2'
	end
	jump 'loop1'
end

i = 0
:loop3
if i < 52:
	j = rand(0, 51)
	temp = deckFace[i]
	deckFace[i] = deckFace[j]
	deckFace[j] = temp
	$text = $deckImg[i]
	$deckImg[i] = $deckImg[j]
	$deckImg[j] = $text
	i += 1
	jump 'loop3'
end

--- deckShuffle ---------------------------------