v0.1.0 chess game in go, using external stockfish engine
This commit is contained in:
26
cmd/chess/main.go
Normal file
26
cmd/chess/main.go
Normal file
@ -0,0 +1,26 @@
|
||||
// FILE: cmd/chess/main.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"chess/internal/cli"
|
||||
"chess/internal/service"
|
||||
clitransport "chess/internal/transport/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
svc, err := service.New()
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to start: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer svc.Close()
|
||||
|
||||
view := cli.New(os.Stdin, os.Stdout)
|
||||
handler := clitransport.New(svc, view)
|
||||
|
||||
view.ShowWelcome()
|
||||
handler.Run() // All game loop logic is in the handler
|
||||
}
|
||||
24
cmd/chessd/main.go
Normal file
24
cmd/chessd/main.go
Normal file
@ -0,0 +1,24 @@
|
||||
// FILE: cmd/chessd/main.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"chess/internal/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Placeholder for future API server implementation
|
||||
svc, err := service.New()
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to initialize service: %v", err)
|
||||
}
|
||||
defer svc.Close()
|
||||
|
||||
// TODO: Phase 2 - Add HTTP/WebSocket server here
|
||||
fmt.Println("Chess server daemon - not yet implemented")
|
||||
fmt.Println("This will host the API in Phase 2")
|
||||
os.Exit(0)
|
||||
}
|
||||
Reference in New Issue
Block a user