This file contains hidden or 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 Tuple(car, cdr) { | |
this.car = car | |
this.cdr = cdr | |
} | |
function List(val) { | |
Tuple.call(this, val, null) | |
} | |
List.prototype = Object.create(Tuple.prototype) |
This file contains hidden or 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
/** | |
* Trie | |
*/ | |
function trie(s) { | |
s += '' | |
var t = {} | |
s.length > 1 ? t[s[0]] = trie(s.substring(1)) : s.length ? t[s] = false : t = false | |
return t | |
} |
This file contains hidden or 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
/** | |
* Tel seznam trie | |
*/ | |
function trie(key, value) { | |
key += '' | |
var t = {} | |
key.length > 1 ? t[key[0]] = trie(key.substring(1), value) : t[key] = {val: value} | |
return t | |
} |
This file contains hidden or 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
/** | |
* Self modifying code | |
*/ | |
function genF(x) { | |
return new Function('x', 'return x + ' + x) | |
} | |
function screw(f) { | |
var src = f.toString() |
This file contains hidden or 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
var c,i,s,p,opcodes | |
c = '10 20 add 5 sub' | |
i = 0 | |
s = new Array(100) | |
p = -1 | |
opcodes = { | |
'add': 's[p - 1] = s[p--]*1 + s[p]*1', | |
'sub': 's[p - 1] = s[p - 1]*1 - s[p--]*1;' | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<title>pico-elm2</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
background-color: #E1E7EF; | |
} | |
.app { | |
width: 200px; | |
overflow: auto; |
This file contains hidden or 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
; Number je nakej primitivni datovy typ treba | |
[ > ] (Number Number) : vetsi-mensi | |
[ - ] (vetsi-mensi) : odcitani-co-skonci-kladne | |
; ta typova anotace se da udelat i anonymni | |
[ - ] ( > ) : odcitani-co-skonci-kladne |
This file contains hidden or 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
{ | |
"boardSize": [8,8], | |
"player1": -1, | |
"player2": 1, | |
"initialBoard": [ | |
[0,0,0,0,0,0,0,0], | |
[1,1,1,1,1,1,1,1], | |
[1,1,1,1,1,1,1,1], | |
[0,0,0,0,0,0,0,0], | |
[0,0,0,0,0,0,0,0], |
This file contains hidden or 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
const readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
let stack = []; | |
let consts = { | |
swapd: '[[swap] dip]', | |
popd: '[[pop] dip]', |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#define BSIZE 8 | |
#define ERRSCAN 1 | |
#define ERRMEM 2 | |
typedef struct vec { | |
char x; | |
char y; |