Skip to content

Instantly share code, notes, and snippets.

@recursivecodes
Created August 7, 2018 17:23
Show Gist options
  • Save recursivecodes/27b4c9eeefc5e9ea965efeba60aeac14 to your computer and use it in GitHub Desktop.
Save recursivecodes/27b4c9eeefc5e9ea965efeba60aeac14 to your computer and use it in GitHub Desktop.
println "Shuffled deck--> ${deck}"
def hands = [ [], [], [], [], [], [], [], [] ]
def cardsPerPlayer = 2
(0..cardsPerPlayer-1).each {
hands.each {
it << deck.remove(0)
}
}
println "Player hands--> ${hands}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment