-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
44 lines (33 loc) · 943 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
42
43
44
package main
import (
// "tournaments/server/models"
"fmt"
"os"
)
// TODO: create both proyects: client and server
func main() {
// playerCount := 16
// players := make([]models.Player, playerCount)
// // matches := make([]models.Match, playerCount/2)
// for i := 0; i < playerCount; i++ {
// players[i] = models.NewPlayerData(i + 1)
// }
// // for i := 1; i < playerCount; i += 2 {
// // matches[i/2] = models.NewMatchData(players[i], players[i-1])
// // }
// tournament := models.NewTournamentData(players)
// winner := tournament.Winner()
// fmt.Printf("winner: %s\n", winner.Id())
// server.Run()
// _, err := net.Listen("tcp", ":8080")
// if err != nil {
// fmt.Println("Port is in use")
// }
// client.Run()
content, err := os.ReadFile("./server/players/greedy.go")
if err != nil {
fmt.Println("Error reading file:", err)
return
}
server.ReceivePlayerImpl(string(content), "NewGreedyPlayer")
}