Skip to content

Instantly share code, notes, and snippets.

View rj00a's full-sized avatar
🤔

Ryan Johnson rj00a

🤔
  • California
  • 05:47 (UTC -07:00)
View GitHub Profile
@rj00a
rj00a / registry-codec.json
Created July 3, 2022 19:28
The 1.19 Registry Codec
{
"minecraft:worldgen/biome": {
"value": [
{
"id": 0,
"element": {
"precipitation": "none",
"temperature": 0.5,
"downfall": 0.5,
"effects": {
@rj00a
rj00a / wfc.rs
Created May 2, 2022 10:06
wave function collapse
// WARNING: Old code. Wrote this a while ago.
//! An interface for solving Constraint Satisfaction Problems (CSPs)
use bitvec::prelude::*;
use indexmap::IndexSet;
use log::warn;
use ndarray::prelude::*;
use num_enum::IntoPrimitive;
use rand::{distributions::WeightedError, prelude::*};
@rj00a
rj00a / calc.c
Created October 14, 2019 21:49
Pratt Parser Calculator in C
// (Public domain, created by Ryan Johnson)
// A simple calculator in C using Pratt parsing.
// compile with `cc -lm calc.c`
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <inttypes.h>
#include <ctype.h>
#include <math.h>
@rj00a
rj00a / calc.c
Last active October 10, 2019 10:55
Simple Recursive Descent Calculator in C
// (Public domain, created by Ryan Johnson)
// A simple recursive descent calculator in C.
// compile with `cc -lm calc.c`
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <inttypes.h>
#include <ctype.h>
#include <math.h>
@rj00a
rj00a / markov.py
Last active May 29, 2019 06:01
Simple Markov chain generator in Python
import random
# Generates markov chains using sequences of characters
class MarkovChar:
def __init__(self, seq_size):
# key type: chracter sequence
# value type: another map of character sequences to ints (occurance count)
self.prob_map = {}
self.seq_size = seq_size