Skip to content

Instantly share code, notes, and snippets.

View lrlucena's full-sized avatar
🦐
Working on Potigol Language (potigol.github.io)

Leonardo Lucena lrlucena

🦐
Working on Potigol Language (potigol.github.io)
View GitHub Profile
@lrlucena
lrlucena / copa.txt
Created May 29, 2014 00:13
Álbum da copa
Figurinhas Repetidas
1, 8, 13, 15, 21, 23, 27, 31, 39, 41, 46, 51, 54, 55, 60, 68, 72, 73, 75, 79, 80, 81, 82, 83, 84, 85, 87, 91, 95, 96, 97, 102, 104, 108, 110, 111, 113, 114, 116, 118, 124, 126, 127, 138, 143, 145, 148, 150, 151, 152, 153, 156, 158, 163, 178, 192, 193, 197, 200, 201, 207, 208, 210, 212, 213, 214, 216, 217, 226, 227, 230, 232, 233, 234, 237, 238, 245, 248, 250, 254, 265, 282, 284, 290, 296, 297, 312, 317, 320, 324, 350, 355, 358, 370, 374, 385, 387, 389, 392, 399, 404, 416, 417, 419, 421, 422, 427, 432, 446, 449, 450, 455, 456, 472, 481, 491, 493, 494, 496, 500, 505, 507, 509, 510, 511, 513, 523, 528, 529, 531, 539, 543, 546, 551, 574, 580, 584, 587, 588, 604, 605, 606, 621, 628, J2, L1
@lrlucena
lrlucena / copa.txt
Created May 29, 2014 00:23
Copa faltam
Figurinhas que faltam
3, 4, 5, 7, 17, 19, 122, 123, 129, 130, 136, 140, 141, 147, 171, 175, 189, 219, 258, 259, 262, 263, 264, 267, 270, 271, 280, 288, 302, 303, 305, 308, 318, 337, 342, 344, 346, 347, 360, 364, 365, 372, 383, 396, 414, 433, 439, 442, 443, 465, 467, 479, 485, 486, 506, 514, 515, 522, 524, 525, 547, 548, 549, 553, 564, 565, 566, 569, 570, 576, 582, 590, 591, 599, 608, 630, 631, 632, 639
package agenda2
class Contato(val nome: String, val telefone: String = "",
val endereco: String = "", val eMail: String = "")
object Teste {
val joao = new Contato("Joao")
val jose = new Contato("Jose", "99999-9999", "Rua do Bobo, 0", "jose@agenda.com.br")
}
@lrlucena
lrlucena / MaiorMenor2.poti
Last active August 29, 2015 14:16
Exemplo Jogo Maior Menor - Programação funcional
escreva "Jogo Maior - Menor"
escreva "Eu escolhi um número entre 1 e 100. Tente adivinhar."
jogo(numero, tentativas: Inteiro): Inteiro
palpite = leia_inteiro
se palpite < numero então
escreva "O número é maior do que {palpite}"
jogo(numero, tentativas + 1)
senãose palpite > numero
escreva "O número é menor do que {palpite}"
@lrlucena
lrlucena / MaiorMenor1.poti
Last active August 29, 2015 14:16
Jogo Maior Menor - programação imperativa
escreva "Jogo Maior - Menor"
numero = aleatório(1, 100)
escreva "Eu escolhi um número entre 1 e 100. Tente adivinhar."
var palpite := leia_inteiro
enquanto palpite <> numero faça
se palpite < numero então
package br.edu.ifrn.linguagem;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeProperty;
import org.antlr.v4.runtime.tree.TerminalNode;
public class MinhaLinguagem extends linguagemBaseListener {
private final ParseTreeProperty<String> values = new ParseTreeProperty<String>();
class MaiorMenor
def initialize()
@numero = rand(100) + 1
@fim_de_jogo = false
end
def palpite(valor)
if valor < @numero then
resposta = "O numero eh maior do que #{valor}: "
elsif valor > @numero then
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"><link rel="stylesheet" href="potigol.css"><head>
<body><button onclick="javascript:window.print();">Print this page</button>
<pre><span class="comentario"></span>x<span class='atribuicao'> = </span>10
<span class="comentario"># Valor fixo
</span><span class='chave'>var </span>y<span class='atribuicao'> := </span>10
<span class="comentario"># Valor alterável
</span>y<span class='atribuicao'> := </span>y <span class='operador'>+</span> 2
@lrlucena
lrlucena / curso.xml
Created September 21, 2011 18:11
Cursos.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr bgcolor="#9acd32">
<th>Curso</th>
<th>Modalidade / Campus</th>
x = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10