Skip to content

Instantly share code, notes, and snippets.

View Reconcyl's full-sized avatar

Reconcyl Reconcyl

View GitHub Profile

MetaFractran is a version of Fractran in which the entire program is encoded in the program file's metadata - specifically, its file name and path.

Say the program file is located in /home/metafractran/7:3/99:98/13:49/39:35/36:91/10:143/49:13/7:11/1:2/91:1/10.mfc. Only the trailing components of the file path that match the regex \d+:\d+ will be kept, and the rest will be ignored. The file name can have an optional extension, which is ignored. The contents of the file do not matter; however, a compliant implementation must verify that the file exists.

This file corresponds to the program 7/3 99/98 13/49 39/35 36/91 10/143 49/13 7/11 1/2 91/1, with a starting number of 10.

@Reconcyl
Reconcyl / mmp.py
Last active November 2, 2017 04:18
Intepreter for the MMP esolang: https://esolangs.org/wiki/MMP
# An interpreter for the MMP (MultiMath Processor) esolang.
# Has no dependencies other than the standard library.
# A few things to note:
# - Cells contain unbounded integers.
# - Arithmetic is signed, and negative tape indices are allowed.
# - Tape and registers are initialized to 0.
# - Invalid commands are ignored.
# - IP out-of-bounds ends execution.
# - Instructions are indexed from zero.
@Reconcyl
Reconcyl / gfm_test.md
Last active July 7, 2018 04:51
GFM test

header asd

<html>
<head>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
<body>
<b>Code:</b>
<br/>
<textarea id="code" width="300" height="300"></textarea>
@Reconcyl
Reconcyl / maze_generator.py
Last active September 15, 2018 08:32
Maze generator
import random
import time
WALL = " "
GAP = "@"
def split(string, width):
for i in range(0, len(string), width):
yield string[i : i+width]
@Reconcyl
Reconcyl / maze_generator.rs
Created September 16, 2018 22:58
Faster maze generator
//! A faster rewrite of `maze_generator.py` in Rust.
//!
//! The Python version generated a 100x200 maze in about thirty seconds.
//! This version generated a 1000x1000 maze in about five seconds.
extern crate rand;
extern crate itertools;
extern crate integer_sqrt;
use rand::Rng;
@Reconcyl
Reconcyl / Assistant.hs
Created May 3, 2019 18:43
Professor at MIT can read minds!
{-# LANGUAGE ViewPatterns #-}
import Data.Ord (Down (..))
import Data.List (sort, sortOn, elemIndex, groupBy)
import Data.Function (on)
-- == -- == == -- == --
-- == -- == UTILITY FUNCTIONS == -- == --
-- == -- == == -- == --
@Reconcyl
Reconcyl / underload.tamsin
Created June 4, 2019 03:08
Underload Interpreter in Tamsin
# An Underload interpreter written in Tamsin.
# Only supports programs containing only `a^:!S~*()`.
# Concatenate two lists.
concat(nil, R) = return R.
concat(cons(A, AS), R) = concat(AS, R) -> R2 & return cons(A, R2).
# Parse a term into an AST.
term = "a" & return wrap
| "^" & return exec
@Reconcyl
Reconcyl / main.py
Created August 16, 2019 07:46
Mancala Brute Forcer (txti.es/mancala)
SIDE_LENGTH = 6
HOLE_INIT = 4
STONES = 2 * SIDE_LENGTH * HOLE_INIT
class Board:
def __init__(self, holes=None):
if holes:
self.holes = holes
else:
@Reconcyl
Reconcyl / README.md
Created December 5, 2020 04:01
Serrific macdown theme

Serrific: a barebones serif MacDown theme

These are just settings that look reasonable to me. Note that this doesn't have any rules for things I don't use.