Skip to content

Instantly share code, notes, and snippets.

View zbanks's full-sized avatar
👍

Zach Banks zbanks

👍
View GitHub Profile

These were generated from a markov chain which was fed from a combination of:

  • Soulsborne text (DS1, DS2, DS3, BB; item descriptions + dialog)
  • Linux kernel documentation (5.11; *.rst files)

I generated a bunch of content, and this is the top ~15% or so. I then threw out results that were obviously only drawing from one of souls/linux, or total nonsense. I've also attempted to roughly sort them from best-to-worst.


@zbanks
zbanks / reverse_for.c
Last active March 15, 2018 19:35
Backwards for loops
//usr/bin/gcc -Wall -Wextra -Wpedantic -Wconversion -std=c99 reverse_for.c -o reverse_for && ./reverse_for
// https://github.com/zbanks
#include <stdio.h>
#define for(BODY) for2(__COUNTER__, _count, _i, BODY)
#define for2(_uniq, _count, _i, BODY) for3(_uniq, _count, _i, BODY)
#define for3(_uniq, _count, _i, BODY) for4(_count ## _uniq, _i ## _uniq, BODY)
#define for4(_count, _i, BODY) \
long _count = 1; \
for (BODY) _count++; \
// Common:
struct endpoint {
struct node * node;
pull_fn_pt pull;
//const type_t * type; // Maybe...
//const char * name; // Maybe...
};
// Type 1:
struct node {
function randomChoice(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}
function randint(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function drawCircleANotFilled(ctx, x, y, radius, width, color) {
ctx.beginPath();