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
# Imprimir posição e valor | |
lista = ["TADS", "IFRN", "Natal"] | |
para i de 1 até lista.tamanho faça | |
nome = lista[i] | |
escreva "{i} - {nome}" | |
fim |
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
para i de 1 ate 10 faca { | |
escreva i; | |
i := i + 2 | |
}; | |
escreva i |
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
# 12. Brincadeira do ímpar ou par: | |
# escreva um programa que leia dois nomes e | |
# dois valores inteiros, que correspondem ao | |
# que cada um colocou, e informe quem ganhou | |
# o “ímpar ou par”. | |
imprima "Quem é par? " | |
par = leia_texto | |
imprima "Quem é ímpar? " | |
impar = leia_texto | |
escreva "Coloque os números:" |
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
x := 5; | |
exiba "Qual a senha?"; | |
y := Leia; | |
enquanto nao(x = y) { | |
exiba "Qual a senha?"; | |
y := Leia; | |
}; | |
exiba "Acertou" |
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
grammar Linguagem1; | |
documento: bloco* ; | |
bloco: 'h1' Texto | |
| 'p' Texto | |
| form | |
; | |
form: 'form' '{' elemento* '}'; |
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
package whilelang | |
import org.antlr.v4.runtime.ParserRuleContext | |
import org.antlr.v4.runtime.tree._ | |
import whilelang.{ WhilelangParser => C } | |
import plp.enquanto.linguagem.Linguagem._ | |
trait Antlr2Scala { | |
protected val values = new ParseTreeProperty[Any] |
Arquivo de definição da sintaxe de Potigol usando o ACE
Teste em: https://ace.c9.io/tool/mode_creator.html
Cole o arquivo potigol.js
no lado esquerdo e o arquivo exemplo.poti
no lado direito.
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
https://www.dropbox.com/s/nny7objxs401rnn/potigol097.zip?dl=0 |
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
/* | |
Crie um programa para construir uma página HTML usando a função: | |
def pagina(font: String, cor: String)(titulo: String, | |
pessoas: List[Pessoa], mensagem: String): String | |
Uma pessoa pode ser um Aluno (nome, matricula, curso, periodo) | |
ou | |
Professor (nome, matricula, disciplina, diretoria). | |
*/ |