Skip to content

Instantly share code, notes, and snippets.

Avatar
🦐
Working on Potigol Language (potigol.github.io)

Leonardo Lucena lrlucena

🦐
Working on Potigol Language (potigol.github.io)
View GitHub Profile
View buracos.poti
# potigol.github.io
# https://twitter.com/LucasTeles42/status/1514226905809100802
buracos(entrada, saída: Lista[Caractere]): Texto =
se entrada.tamanho < 2 então
saída.inverta.junte("")
senãose entrada[2] - entrada[1] > 1 então
c = (entrada[1] + 1).caractere
buracos(c :: entrada.cauda, c :: saída)
senão
@lrlucena
lrlucena / mapa.poti
Last active Jun 26, 2017
Jogo para percorrer um mapa
View mapa.poti
mapa = Matriz.mutavel(12,12," ")
PAREDE = "▓"
JOGADOR = "♞"
var x := 3
var y := 11
montar_mapa()
para i de 1 até 12 faça
mapa[i][1] := PAREDE
mapa[i][12] := PAREDE
View fibonacci_sequence.py
# -*- coding: utf-8 -*-
'''
Autor: Luiz Felipe na Lista Python Brasil 31-10-2015
A série de Fibonacci é formada pela seqüência 1,1,2,3,5,8,13,21,34,55,...
Faça um programa capaz de gerar a série até o n−ésimo termo.
'''
#Fn = F(n-1) + F(n-2)
@iamnewton
iamnewton / bash-colors.md
Last active Aug 5, 2022
The entire table of ANSI color codes.
View bash-colors.md

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@rxaviers
rxaviers / gist:7360908
Last active Aug 15, 2022
Complete list of github markdown emoji markup
View gist:7360908

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jeffreyolchovy
jeffreyolchovy / LRUCache.scala
Created Aug 6, 2012
LRU cache implementation in Scala
View LRUCache.scala
import akka.stm._
import scala.collection.immutable.ListMap
case class LRUCache[A, B](private val MAX_ENTRIES: Int)
{
protected val cache = Ref(ListMap.empty[A, B])
def getOrElse(key: A)(fn: => B): B = {
get(key).getOrElse {
val result = fn
@paulmillr
paulmillr / type-inference.coffee
Created Jul 17, 2012
Damas-Hindley-Milner type inference algorithm in LiveScript
View type-inference.coffee
# Algorithm W (Damas-Hindley-Milner) in LiveScript.
# By Paul Miller (paulmillr.com), Public domain.
#
# Based on Robert Smallshire's [Python code](http://bit.ly/bbVmmX).
# Which is based on Andrew's [Scala code](http://bit.ly/aztXwD).
# Which is based on Nikita Borisov's [Perl code](http://bit.ly/myq3uA).
# Which is based on Luca Cardelli's [Modula-2 code](http://bit.ly/Hjpvb).
# Something like that.
prelude = require './prelude'
@lrlucena
lrlucena / Q01.rb
Last active Oct 7, 2015
Gabarito da Lista de Exercícios 12
View Q01.rb
# Escreva uma classe, chamada Ponto, que representa um ponto no
# plano cartesiano. A figura abaixo mostra quais atributos e métodos
# da classe.
class Ponto
attr_reader :x, :y
def initialize(x,y)
@x = x
@y = y