Commit ccd9a949 authored by Felipe Chilla's avatar Felipe Chilla
Browse files

Print message when waiting for lider

parent d2510236
1 merge request!1Join player leader
Showing with 6 additions and 2 deletions
+6 -2
......@@ -65,6 +65,7 @@ func jugar(isbot bool, port string, WG *sync.WaitGroup) {
}
order = service.Wait_Step(want_money, port)
fmt.Println("Esperando respuesta del lider...")
if order == "Cancelado" {
if !isbot {
fmt.Println("El juego fué cancelado")
......@@ -94,6 +95,7 @@ func jugar(isbot bool, port string, WG *sync.WaitGroup) {
i++
service.Send_Jugada(number, port, isbot)
fmt.Println("Esperando respuesta del lider...")
order = service.Wait_Step(want_money, port)
want_money = false
if order == "Cancelado" {
......@@ -120,7 +122,7 @@ func jugar(isbot bool, port string, WG *sync.WaitGroup) {
return
} else if win_1 && win_2 && win_3 {
if !isbot {
fmt.Printf("Has ganado!")
fmt.Println("Has ganado!")
}
return
}
......@@ -139,6 +141,7 @@ func jugar(isbot bool, port string, WG *sync.WaitGroup) {
want_money = true
}
service.Send_Jugada(number, port, isbot)
fmt.Println("Esperando respuesta del lider...")
order = service.Wait_Step(want_money, port)
want_money = false
if order == "Cancelado" {
......@@ -188,6 +191,7 @@ func jugar(isbot bool, port string, WG *sync.WaitGroup) {
service.Send_Jugada(number, port, isbot)
order = service.Wait_Step(want_money, port)
fmt.Println("Esperando respuesta del lider...")
if order == "Cancelado" {
if !isbot {
fmt.Println("El juego fué cancelado")
......@@ -197,7 +201,7 @@ func jugar(isbot bool, port string, WG *sync.WaitGroup) {
if order == "Ganaste" {
win_3 = true
if !isbot {
fmt.Printf("Has ganado!")
fmt.Println("Has ganado!")
}
} else if order == "Muerto" {
eliminated = true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment