forked from COLTEC-DAW/E05-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConceitos Basicos.js
More file actions
47 lines (40 loc) · 1.11 KB
/
Copy pathConceitos Basicos.js
File metadata and controls
47 lines (40 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function DesenhaTriangulo(){
var altura = prompt("Digite a altura do Triangulo:");
for (var i = 0; i<= altura; i++){
for(var j = 0; j <= i; j++){
console.log("#");
}
console.log("\n");
}
}
DesenhaTriangulo();
function Tabuleiro(){
var linhas = prompt("Digite a quantidade de linhas do tabuleiro:");
for(var i=0; i< linhas; i++){
console.log("# # # #");
console.log("\n");
}
}
Tabuleiro();
function EhPalindromo(){
var word = prompt("Digite uma palavra ou uma frase para verificar se eh um palindromo");
word = word.toUpperCase();
word = word.split('').join('');
var InvertidaWord = word.split('').reverse().join('');
if (word == InvertidaWord){
console.log("Eh um palindrmo");
}
else{
console.log("Nao eh um palindromo");
}
}
EhPalindromo();
function max(a,b){
if(a > b){
return a;
}else if(a < b){
return b;
}else if (a == b){
return 0;
}
}