main.go

 avatar
unknown
plain_text
4 months ago
433 B
6
Indexable
package main

import (
	"myapp/game"
)

func main() {
	g := game.Game{
		DisplayChan: make(chan string),
		RoundChan:   make(chan int),
		Round: game.Round{
			RoundNumber:   0,
			ComputerScore: 0,
			PlayerScore:   0,
		},
	}
	go g.Rounds()
	g.ClearScreen()
	g.PrintIntro()
	for g.Round.RoundNumber < 3 {
		g.RoundChan <- 1
		<-g.RoundChan
		if !g.PlayRound() {
			g.RoundChan <- -1
			<-g.RoundChan
		}

	}
	g.PrintFinalScore()
}
Editor is loading...
Leave a Comment