Skip to content

Instantly share code, notes, and snippets.

View recursivecodes's full-sized avatar
💯
Living the dream

Todd Sharp recursivecodes

💯
Living the dream
View GitHub Profile
def suits = ['❤️', '♠️', '♣️', '♦️']
def cards = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
def deck = []
[cards, suits].combinations().each {
deck << it.join()
}
Collections.shuffle(deck)
println "Shuffled deck--> ${deck}"
def hands = [ [], [], [], [], [], [], [], [] ]
def cardsPerPlayer = 2
(0..cardsPerPlayer-1).each {
hands.each {
it << deck.remove(0)
}
}
// community cards
def communityCards = []
def burnPile = []
def deal = { int c = 0 ->
burnPile << deck.remove(0)
(0..( c - 1 )).each {
communityCards << deck.remove(0)
}
}
Shuffled deck--> [8♣️, 9♦️, 6♣️, 8♠️, 3♠️, 7♠️, 5♦️, K♠️, 2♠️, 3♦️, 6♠️, K♣️, 5♣️, 4❤️, 7❤️, 3❤️, 4♣️, 9❤️, Q♦️, A♦️, 6❤️, Q❤️, 2♣️, 7♣️, 4♦️, K❤️, 2♦️, 5❤️, 5♠️, A♣️, 7♦️, 2❤️, 9♠️, J♠️, 3♣️, 6♦️, 10♣️, 10♦️, K♦️, J♦️, 9♣️, A♠️, J❤️, 10❤️, J♣️, 10♠️, 4♠️, Q♠️, Q♣️, A❤️, 8❤️, 8♦️]
Player hands--> [[8♣️, 2♠️], [9♦️, 3♦️], [6♣️, 6♠️], [8♠️, K♣️], [3♠️, 5♣️], [7♠️, 4❤️], [5♦️, 7❤️], [K♠️, 3❤️]]
Flop --> [9❤️, Q♦️, A♦️]
Turn --> [9❤️, Q♦️, A♦️, Q❤️]
River --> [9❤️, Q♦️, A♦️, Q❤️, 7♣️]
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
#define SENSOR A0
#define LED 9
#define BUZZER 11
void setup() {
pinMode(SENSOR, INPUT);
pinMode(LED, OUTPUT);
pinMode(BUZZER, OUTPUT);
Serial.begin(9600);
}