Compare commits
5 Commits
a55499bf40
...
teste-jim
| Author | SHA1 | Date | |
|---|---|---|---|
| fd08173ed1 | |||
| 722d9a5fe1 | |||
| 0ab7def81d | |||
| 439bd0caf2 | |||
| 87d6028414 |
@@ -16,6 +16,7 @@ func main() {
|
|||||||
fmt.Println("Bem-vindo ao jogo de adivinhação!")
|
fmt.Println("Bem-vindo ao jogo de adivinhação!")
|
||||||
fmt.Printf("Você tem %d tentativas para adivinhar o número entre 1 e 10.\n", TENTATIVAS)
|
fmt.Printf("Você tem %d tentativas para adivinhar o número entre 1 e 10.\n", TENTATIVAS)
|
||||||
|
|
||||||
|
// inicializando variável de tentativa
|
||||||
tentativa := 0
|
tentativa := 0
|
||||||
|
|
||||||
for tentativa < TENTATIVAS {
|
for tentativa < TENTATIVAS {
|
||||||
@@ -30,7 +31,7 @@ func main() {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Deve ser informado um número.")
|
fmt.Println("Deve ser informado um número.")
|
||||||
continue // colocado para pular a proxima iteração e não contar a tentativa
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
@@ -44,4 +45,5 @@ func main() {
|
|||||||
|
|
||||||
tentativa++
|
tentativa++
|
||||||
}
|
}
|
||||||
|
// comentario do Davi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user