Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheiro22 authored Sep 20, 2023
1 parent 6a3eb77 commit a2aac37
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
12 changes: 12 additions & 0 deletions aulas/aula17.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Estruturas de Controle
Laços de repetições
while | do while

while (condição) {
//condição verdadeira
}

do {
//sempre executa o código 1 vez independente da condição
//depois analisa a condição(semelhante a estrutura while)
} while (condição)
10 changes: 10 additions & 0 deletions exercicios/tabuadawhile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Exemplo de uso da estrutura while
*/

let valor = 7
let i = 1
while (i < 11) {
console.log(`${valor} x ${i} = ${i * valor}`)
i++
}
7 changes: 5 additions & 2 deletions fundamentos/dado.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
const read = require('readline-sync')

let face
let escolha = "s"

do {
console.clear()
console.log("------ Jogo do dado -------")
read.question("Pressione a tecla [Enter] para jogar o dado: ")
Expand Down Expand Up @@ -53,7 +55,8 @@ switch (face) {
console.log("|O O|")
console.log("|O_____O|")
break
}


}
escolha = read.question("Deseja jogar novamente(s/n)?")
} while(escolha === "s")
console.log(`Face do dado: ${face}`)
21 changes: 21 additions & 0 deletions fundamentos/while.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Estudo das estruturas de controle
* while | do while
*/

const read = require('readline-sync')

let x = 1;
let y = 1;

while (x < 11) {
console.log("teste da estrutura while")
x++
}

read.question("Pressione a tecla [ENTER] para continuar")

do {
console.log("teste da estrutura do-while")
y++
} while (y < 11)

0 comments on commit a2aac37

Please sign in to comment.