Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Felipe Maximiliano Chilla Arévalo
squid-game
Commits
ccd9a949
Commit
ccd9a949
authored
3 years ago
by
Felipe Chilla
Browse files
Options
Download
Patches
Plain Diff
Print message when waiting for lider
parent
d2510236
main
1 merge request
!1
Join player leader
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jugador/main.go
+6
-2
Jugador/main.go
with
6 additions
and
2 deletions
+6
-2
Jugador/main.go
+
6
−
2
View file @
ccd9a949
...
...
@@ -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
.
Print
f
(
"Has ganado!"
)
fmt
.
Print
ln
(
"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
.
Print
f
(
"Has ganado!"
)
fmt
.
Print
ln
(
"Has ganado!"
)
}
}
else
if
order
==
"Muerto"
{
eliminated
=
true
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets