Instantly share code, notes, and snippets.

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

# Leonardo Lucena lrlucena

🦐
Working on Potigol Language (potigol.github.io)
Created April 29, 2024 00:53
This file contains 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
 defmodule Primality do # O jeito "ingênuo" de checar por primalidade é você simplesmente verificar # se o número tem divisores. Ou seja, você pega todos os números menores # que o seu número-alvo (começando em 2, pois 1 divide todos os números) # e verifica se eles dividem o número (ou seja, se o resto da divisão - # função `rem/1` - é igual a 0). # # Também precisamos de um caso especial para 1, que não tem divisores mas não # é primo. def check_naive(1), do: false
Last active April 16, 2022 02:37
This file contains 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
Last active June 26, 2017 11:27
Jogo para percorrer um mapa
This file contains 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
 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
Last active September 23, 2016 14:26
Created November 1, 2015 18:22
This file contains 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
 # -*- 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)
Last active September 23, 2016 14:28
Last active May 27, 2024 23:36
The entire table of ANSI color codes.

# 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
Last active June 21, 2024 05:10
Complete list of github markdown emoji markup

People

`: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:`
Created August 6, 2012 21:19
LRU cache implementation in Scala
This file contains 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
 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
Created July 17, 2012 17:39
Damas-Hindley-Milner type inference algorithm in LiveScript
This file contains 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
 # 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'