-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (36 loc) · 898 Bytes
/
main.go
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
38
39
40
41
package main
import (
"fmt"
)
var currentRound *Round
func getPlayers() []*Player {
var name string
var players []*Player
for i := 0; i < 2; i++ {
fmt.Printf("Enter Player%d name:", i)
_, err := fmt.Scanln(&name)
if err != nil {
fmt.Print(err)
continue
}
players = append(players, NewPlayer(name))
}
return players
}
func main() {
fmt.Println("Starting new game\n")
players := getPlayers()
currentRound = NewRound(players)
fmt.Printf("there are %d players\n", currentRound.NumberOfPlayers())
for i := 0; i < currentRound.NumberOfActivePlayers(); i++ {
fmt.Printf("%s has %s in their hand\n", players[i].Name, players[i].Hand[0].Name())
}
fmt.Println("====Log====")
currentRound.PrintLog()
}
// Order of play:
// Deal cards to all players.
// Current player takes second card
// Current player makes decision + Discards card
// Action is resolved
// Next player