Skip to content

Instantly share code, notes, and snippets.

View lynn's full-sized avatar
🐞

Lynn lynn

🐞
View GitHub Profile
@lynn
lynn / KnyttStoriesMapper.hs
Created February 1, 2016 19:49
Knytt Stories level map renderer
-- Pass this program a world name, and run it from the Knytt Stories root directory:
--
-- cd "Knytt Stories"
-- ./KnyttStoriesMapper "Nifflas - The Machine"
--
-- It will create a file called "Nifflas - The Machine.png" containing a map.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
@lynn
lynn / cardinal.py
Last active November 19, 2020 04:54
Cardinal esolang interpreter
#!/usr/bin/env python3
# usage:
# python3 cardinal.py code.cardinal < input.txt
# to show program execution, pass -d and a time delta:
# python3 cardinal.py -d 0.1 code.cardinal < input.txt
import sys
import time
@lynn
lynn / tweetsprint.des
Created January 29, 2017 14:59
tweetsprint
NAME:🏃
TAGS:sprint
MONS:orc,urug,mara
ITEM:orb of zot,random rune
ORIENT:encompass
MAP
bbbbbbbbb|1b
beld=3=2=11=|||{
bbbbbbbbb|1b
ENDMAP
@lynn
lynn / Turing.hs
Last active April 15, 2017 20:41 — forked from nandor/Turing.hs
Haskell Turing Machine
import Data.Map(Map, fromList, lookup, union)
import Control.Monad(msum)
fromMay d = (!!0) . foldr (:) [d]
mapIns :: (Ord k) => k -> a -> Map k a -> Map k a
mapIns k a = union (fromList [(k, a)])
-- | A TM to add 1 to a binary natural.
incr :: (Int, [Int], [(Int, Int, Char, Char, Int)])
@lynn
lynn / random-rhymes.py
Last active January 7, 2018 21:09
Turn English text into nonsense that sounds like the input
from collections import defaultdict
import fileinput
import random
import re
common = """the of and to a in for is on that by this with
i you it not or be are from at as your all have an was we
will can us i'm it you're i've my of""".split()
pronounce = {}
@lynn
lynn / lojban.md
Last active July 19, 2023 19:53
The Lojban I speak

The Lojban I speak

by la lalxu (Lynn)

This is a list of ways in which my dialect of Lojban differs from the dialect described in The Complete Lojban Language. Most people on the #lojban IRC channel seem to accept and use most of these changes, as well.

The sections marked with an asterisk are approved as part of “base Lojban” by the BPFK (through a voting process). The other sections are simply unofficial additions that people (including me) like enough to use in daily conversation, because they make the language nicer and simpler.

Morphology

Glides*

In CLL Lojban, cmevla and fu'ivla are allowed to contain consonant-glide-vowel sequences like in kuin (Queen). Because it wasn’t clear where it was a good idea to allow them, the BPFK banned them everywhere! Now you can’t have a glide immediately after a consonant anymore, and you need to insert a vowel, writing kuuín (Ku-ween).

About this guide

This is a brief introduction to Lojban, a constructed human language. It has a very nice, fun, regular grammar that computers and humans alike can understand easily.

Basic grammar

All Lojban words are either particles (tiny words that help the grammar) or verbs (which tell us how nouns relate).

A Lojban sentence consists of a main verb with a bunch of nouns plugged into it.

A Lojban verb definition looks like this:

@lynn
lynn / lojban-thesaurus.md
Last active March 1, 2024 15:34
A semantically sorted list of Lojban root words

Lojban Thesaurus

Translated to Markdown from this ancient TeX file. I’m not sure who made the original.

Hover over a link to see the place structure. Click it to view gismu info on Wiktionary.

1 Structures

1.1 Set, group, mass

@lynn
lynn / twitter-gradient.py
Created May 30, 2017 19:34
Update your Twitter profile color in a day-night gradient cycle
from datetime import datetime, timedelta
from PIL import Image
import twitter
def clock_fraction():
'Return time since midnight rescaled to [0, 1); e.g. 0.5 is noon.'
now = datetime.now()
midnight = now.replace(hour=0, minute=0, second=0, microsecond=0)
return (now - midnight) / timedelta(days=1)
@lynn
lynn / kulni-valsi.md
Last active August 10, 2018 05:28
Lojban words for cultures based on ISO country codes

Lojban words for cultures based on ISO country codes

Many Lojbanists dislike the cultural gismu: merko, fraso, gento, etc. If some cultures get them, and others do not, they’re very direct evidence that Lojban doesn’t treat all cultures the same way, violating one of its own foundational principles (cultural neutrality)!

On the experimental rafsi page, a new system involving the rafsi -goi- is proposed:

-goi- is a proposed special rafsi, modifying the previous rafsi to indicate “cultural rafsi”. This allows rafsi with existing assignments to also be assigned to a culture, giving more space for each major culture to get a rafsi. e.g. -sfegoi- might be able to represent sfe'ero (Swedish), despite -sfe- already being assigned to sefta. In another part of this proposal, existing cultural rafsi will also be reassigned to also use -goi-, so as to be more culturally neutral.

Spheniscine made some suggested reassignmen