-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
37 lines (30 loc) · 881 Bytes
/
main.go
File metadata and controls
37 lines (30 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"strings"
)
func main() {
const firstDeckName = "first_deck"
const secondDeckName = "second_deck"
const handSize = 7
firstDeck := newDeck()
firstDeck.saveToFile(firstDeckName)
secondDeck := newDeck()
secondDeck.saveToFile(secondDeckName)
fmt.Println("--- New Player - Paquito ---")
paquito := createPlayer("Paquito", "Navarro")
paquito.deck = firstDeck
paquito.deck.shuffle()
paquito.hand, paquito.deck = dealHand(paquito.deck, handSize)
fmt.Printf("%+v \n", paquito)
fmt.Println("--- New Player - Gaben ---")
gaben := createPlayer("Gaben", "Newell")
gaben.deck = secondDeck
gaben.deck.shuffle()
gaben.hand, gaben.deck = dealHand(gaben.deck, handSize)
fmt.Printf("%+v \n", gaben)
fmt.Println("--- AND THE BIG WINNER IS!")
winner := playCards(paquito, gaben)
fmt.Print(strings.ToUpper(winner.firstName))
cleanUppDecks()
}