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
-- for testing | |
function server(url) | |
return function (tbl) | |
print(url) | |
for k,v in pairs(tbl) do | |
print(k,v) | |
end | |
end | |
end |
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
// Use \ to escape []% | |
var map = { "\\[": "[", | |
"\\]": "]", | |
"\\%": "%", | |
"[": ":Lbl 0:", | |
"]": ":Goto 0:", | |
"@": ":If ", | |
"#": ":Else", | |
"$": ":Then:", |
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
{- | |
f . g x . h $ y f . g x . h y | |
($) (.) | |
/ \ / \ | |
/ \ / \ | |
(.) y f (.) | |
/ \ .´ `. | |
/ \ .´ `. | |
f (.) (appl) (appl) |
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
NB. I7 bits | |
1 | |
1111 | |
1 101 1 | |
0 101 001 | |
---- |
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
"use strict" | |
// Attempt to shoehorn Lua's (or Python's) "first parameter is `this`" model | |
// into JS's object model. Makes us not have to worry about `this` at all. | |
Function.prototype.applyW = function (args) { | |
return this.apply(null, args) | |
} | |
function wrap(fn) { |
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
console.log(( | |
$=([]+!+[]),_=([]+[][(![]+[])[+[]]+([][[]]+[])[!![]+!+[]+!+[]+!+[]+!+[]]+(![]+[] | |
)[!![]+!+[]]+$[+[]]+$[!![]+!+[]+!+[]]+$[+!![]]]),$_=([]+[][(![]+[])[+[]]+([][[]] | |
+[])[!![]+!+[]+!+[]+!+[]+!+[]]+(![]+[])[!![]+!+[]]+$[+[]]+$[!![]+!+[]+!+[]]+$[+! | |
![]]])[!![]+!+[]+!+[]]+_[!![]+!+[]+!+[]+!+[]+!+[]+!+[]]+_[!![]+!+[]]+(![]+[])[!! | |
[]+!+[]+!+[]]+$[+[]]+$[+!![]]+$[!![]+!+[]]+([]+[][(![]+[])[+[]]+([][[]]+[])[!![] | |
+!+[]+!+[]+!+[]+!+[]]+(![]+[])[!![]+!+[]]+$[+[]]+$[!![]+!+[]+!+[]]+$[+!![]]])[!! | |
[]+!+[]+!+[]]+$[+[]]+([]+[][(![]+[])[+[]]+([][[]]+[])[!![]+!+[]+!+[]+!+[]+!+[]]+ | |
(![]+[])[!![]+!+[]]+$[+[]]+$[!![]+!+[]+!+[]]+$[+!![]]])[!![]+!+[]+!+[]+!+[]+!+[] | |
+!+[]]+$[+!![]],_=$_[$_][$_]("$",$[+!![]]+$[!![]+!+[]+!+[]]+$[+[]]+$[!![]+!+[]]+ |
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
function RPS(count) { | |
this.players = count | |
this.score = range(count).map(Const(0)) | |
this.moves = range(count).map(limit(Array,0)) | |
} | |
RPS.prototype.beats = { "rock": "scissors", | |
"paper": "rock", | |
"scissors": "paper" } |
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
#### Library definitions ######################## | |
#### drop | |
drop2 := drop drop; | |
drop3 := drop drop2; | |
drop4 := drop drop3; | |
drop5 := drop drop4; | |
#### nip | |
nip := dip [drop]; |
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
#!/bin/sed -rf | |
# Sedfuck - brainfuck interpreter in sed. | |
# Written by Jonas Höglund (FireFly, firefly.nu). | |
h | |
s/^(.|[^.])*$/0/ | |
# Setup some memory. | |
s/0/0000000000/g | |
#s/0/0000000000/g |
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
define { | |
-- { drop } | |
foldl { | |
--{ x0 xs f → v, fold list with function } | |
dequote | |
choose{ | |
rearrange{B}{_ B _} | |
}{ |