Created
March 5, 2019 02:13
-
-
Save theuves/30d39bf68c4d6b3ef988bad80fde5751 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
// Algorítmos: Pragramando em JavaScript na língua portuguesa. | |
// | |
programa('Verificador de Maioridade', ($) => { | |
var nome = 'Matheus' | |
var idade = 19 | |
$.se(nome >= 18).então(() => { | |
$.escreva(nome, 'é maior de idade.') | |
}).senão(() => { | |
$.escreva(nome, 'é menor de idade.') | |
}) | |
}) | |
programa('Contador', ($) => { | |
var número = 0 | |
$.enquanto(número <= 10, () => { | |
$.escreva(número) | |
número += 1 | |
}) | |
}) | |
programa('Abecedário da Xuxa', ($) => { | |
var alfabeto = $.lista([ 'a', 'b', 'c' ]) | |
alfabeto.para_cada((item) => { | |
$.se(item == 'a').então(() => { | |
$.escreva('A de amor.') | |
}) | |
$.se(item == 'b').então(() => { | |
$.escreva('B de baixinho.') | |
}) | |
$.se(item == 'c').então(() => { | |
$.escreva('C de coração.') | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment