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
import java.util.ArrayList;
import java.util.List;
public class ParallelStreamDemo {
public static void main(String[] args) {
long t1, t2;
List<Employee> eList = new ArrayList<Employee>();
for(int i=0; i<100; i++) {
@lrlucena
lrlucena / Makefile
Created March 31, 2019 01:56
potigol created by lrlucena - https://repl.it/@lrlucena/potigol
.PHONY: run
file := $(shell ls -Rt | grep \.poti | head -n1)
run:
@java -jar potigol.jar -c -w $(file)
var saida = java.lang.System.out;
var n = -3;
if (n>0)
if (n<10)
saida.println("A");
else
saida.println("B");
@lrlucena
lrlucena / fizzbuzz.poti
Last active November 20, 2018 14:55 — forked from adolfont/fizzbuzz.poti
fizz(numero: Inteiro) = escolha numero
caso n se n mod 3 == 0 => "fizz"
caso _ => "{numero}"
fim
buzz(numero: Inteiro) = escolha numero
caso n se n mod 5 == 0 => "buzz"
caso _ => "{numero}"
fim
@lrlucena
lrlucena / Andando no Tempo.py
Last active August 22, 2018 16:55
Aula 22/08/2018
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
if a==b or a==c or b==c:
print("S")
elif a+b==c or a+c==b or b+c==a:
print("S")
else:
print("N")
@lrlucena
lrlucena / HomeController.java
Created August 17, 2018 17:45
Web 17/08/2018
package controllers;
import play.mvc.*;
/**
* This controller contains an action to handle HTTP requests
* to the application's home page.
*/
public class HomeController extends Controller {
@lrlucena
lrlucena / cinco.py
Created August 16, 2018 17:19
Aula_08_2018
n = int(input("Digite um numero: "))
if n % 5 == 0:
print(n, "é multiplo de 5.")
else:
print(n, "não é multiplo de 5.")
print("fim")
a = 3
b = 4
c = 5
escreva "Escolha um valor para X"
escreva "a, b, c"
x = leia_texto
xis = escolha x
caso "a" => a
caso "b" => b
caso _ => c
tentativa(palpites: Lista[Inteiro], número: Inteiro, saida: Lista[Texto]): Lista[Texto]
palpite = palpites.cabeça
se palpite <> número então
resp = se palpite < número então
"O número é maior do que {palpite}."
senão
"O número é menor do que {palpite}."
fim
tentativa(palpites.cauda, número, saida + [resp])
senão
M = input()
M1, M2, M3 = int(M[-3]),int(M[-2]),int(M[-1])
M1M3=M1*10+M3
M1M2=M1*10+M2
M2M3=M2*10+M3
M2M1=M2*10+M1
M3M1=M3*10+M1
M3M2=M3*10+M2
print(M1, M2, M3)