forked from jim/Jogo-da-adivinhacao
Compare commits
9 Commits
439bd0caf2
...
davi
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bd912345c | |||
| fd08173ed1 | |||
| b026cab53a | |||
| eb233b499d | |||
| 6f3c186b36 | |||
| 4cf64a0479 | |||
| 5de595864c | |||
| 722d9a5fe1 | |||
| 0ab7def81d |
@@ -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 {
|
||||||
@@ -32,11 +33,6 @@ func main() {
|
|||||||
fmt.Println("Deve ser informado um número.")
|
fmt.Println("Deve ser informado um número.")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// talvez não necessite checar se o número é menor que um
|
|
||||||
if chuteInt < 1 {
|
|
||||||
fmt.Println("O número deve ser maior que 0.")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case chuteInt < numero:
|
case chuteInt < numero:
|
||||||
@@ -49,6 +45,5 @@ func main() {
|
|||||||
|
|
||||||
tentativa++
|
tentativa++
|
||||||
}
|
}
|
||||||
|
// comentario do Davi
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comentário para testar alteração por outro usuário
|
|
||||||
|
|||||||
Reference in New Issue
Block a user