All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
yumaikas's Avatar

yumaikas / parse_alta.py

0 likes
0 forks
1 files
Last active 11 months ago
1 #! /bin/env python3
2
3 import re
4 from collections import namedtuple
5
6 Pattern = namedtuple("Pattern", ["stack", "value"])
7 Rule = namedtuple("Rule", ["pattern", "consequence"])
8
9 def parse(code):
10 idx = 0
yumaikas's Avatar

yumaikas / parse_alta.lua

0 likes
0 forks
1 files
Last active 11 months ago
1 local alta = {}
2
3 function alta.parse(code)
4 local idx = 1
5 local STATE_FIND_OUTER_DELIM = "find/outer-delim"
6 local STATE_FIND_INNER_DELIM = "find/inner-delim"
7 local STATE_READ_STACK_NAME = "read/stack-name"
8 local STATE_READ_VALUE_NAME = "read/value-name"
9
10 local state = STATE_FIND_OUTER_DELIM
capitalex's Avatar

capitalex / three-in-a-row.bytetable

0 likes
0 forks
1 files
Last active 11 months ago
1 % search for 3 matching columns
2
3 ------------
4 % if we've reach the end of our spread sheet
5 % end our search in failure
6 [* 1 2]
7 [1 x 1]
8 [* 1 2 3]
9 [x -1 -1 -1]
10 ------------
yumaikas's Avatar

yumaikas / funnyMaze.scm

0 likes
0 forks
1 files
Last active 11 months ago
A random maze solver written in Chicken Scheme
1 (use ncurses posix extras posix-extras loops)
2 (define mazeData
3 (vector "OOOOOOOOOOOOOOO"
4 "O O O OOO O OO"
5 "O O"
6 "O O OOOOOOO O O"
7 "O O O O O"
8 "O OOO OO OOOO"
9 "O O O O"
10 "OO O O O OOO OO"
capitalex's Avatar

capitalex / old_dialogue.gd

0 likes
0 forks
1 files
Last active 11 months ago
1 extends Sequence
2
3 func setup():
4 backdrop_image('qs-background', preload('res://imgs/events/QuickShot00_background.png'))
5 backdrop_image('qs-table', preload('res://imgs/events/QuickShot01_table.png'))
6 backdrop_image('qs-guy', preload('res://imgs/events/QuickShot02_guy.png'))
7
8 func intro():
9 fade_out()
yumaikas's Avatar

yumaikas / derp.comp.tiny.js

0 likes
0 forks
3 files
Last active 11 months ago
1 return function() {
2 let min = Math.min; var max = Math.max; var huge = Number.MAX_SAFE_INTEGER;
3 let self = { state: { strings: [], slots: {} } };
4
5
6 self.counters = {
7 "loop": 1,
8 }
9
10 function match(self, counters) {
capitalex's Avatar

capitalex / going-places.chr

0 likes
0 forks
1 files
Last active 11 months ago
1 go_back, travel_sym(Id), at(FutureLocation)
2 , history(GrandparentId, LastLocation, ParentId), history(ParentId, Location)
3 <=> history(GrandparentId, LastLocation)
4 , at(Location)
5 , travel_sym(ParentId)
6
7 go_back, travel_sym(FutureID), at(FutureLocation), history(Id, Location)
8 <=> at(Location)
9 , travel_sym(Id)
capitalex's Avatar

capitalex / callatz.chr

0 likes
0 forks
2 files
Last active 11 months ago
1 move, y <=> x, move
2 move, x, x <=> x, x, eval
3 move, x <=> x
4
5 odd, y <=> x, x, x, x, x, x, odd
6 odd <=> x, eval
7
8 eval, x, x <=> y, eval
9 eval, x <=> x, x, x, odd
10 eval <=> move
capitalex's Avatar

capitalex / mem.js

0 likes
0 forks
2 files
Last active 11 months ago
1 /**
2 Input program:
3 mem(A,_), mem(A,_) <=> fail
4 prog(L,_,_,_), prog(L,_,_,_) <=> fail
5 pc(_), pc(_) <=> fail
6
7 prog(L,"add",B,A), mem(B,Y) \ mem(A,X), pc(L) <=> mem(A,X+Y), pc(L+1)
8 prog(L,"sub",B,A), mem(B,Y) \ mem(A,X), pc(L) <=> mem(A,X-Y), pc(L+1)
9 prog(L,"mult",B,A), mem(B,Y) \ mem(A,X), pc(L) <=> mem(A,X*Y), pc(L+1)
10 prog(L,"div",B,A), mem(B,Y) \ mem(A,X), pc(L) <=> mem(A,X/Y), pc(L+1)
capitalex's Avatar

capitalex / fruitcake-2.js

0 likes
0 forks
2 files
Last active 11 months ago
1 /**
2 *
3 * Automatically generated
4 * Do not edit
5 *
6 * Created using CHR.js AOT compiler
7 * (CHR.js version v3.3.21)
8 * http://github.com/fnogatz/CHR.js
9 *
10 */
Newer Older

Powered by Opengist ⋅ Load: 224ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文