Skip to content

Instantly share code, notes, and snippets.

View Eroica's full-sized avatar

Seba Eroica

View GitHub Profile
--[[
`Corgi dog' adapted to monospace font
Original ASCII Art
http://asciiart.en.utf8art.com/arc/dog_17.html
Licensed under a Creative Commons Attribution 2.1 Japan License
https://creativecommons.org/licenses/by/2.1/jp/
]]
@Eroica
Eroica / crp.lua
Last active July 19, 2017 08:09
Chinese Restaurant Process in Lua
math.randomseed(os.time())
local function round (n)
if n > 0 then
return math.floor(n + 0.5)
else
return math.ceil(n - 0.5)
end
end