Skip to content

Instantly share code, notes, and snippets.

@ekimekim
ekimekim / throws.py
Created August 3, 2021 18:05
hacked together brute force solver for necrodancer blood shop throws
from collections import namedtuple
class Point(namedtuple('_Point', ['x', 'y'])):
def __add__(self, other):
return Point(self.x + other.x, self.y + other.y)
shopkeeper = Point(2, 1)
rune = Point(2, 5)
size = Point(5, 7)
gold_weapon = Point(1, 3)
#!/bin/bash
gen-keys() {
for control in "$@"; do
echo $enter "$control" $down
done
}
# weird key names
up=Up
#!/bin/env python2
import array
import fcntl
import argh
LIRC_MODE_PULSE = 2
def ioc(dir, type, nr, size):
@ekimekim
ekimekim / probability.py
Last active June 29, 2025 00:13
slots.py is a tool for analyzing the slot machine in The Blue Prince. The text log is experimental data of how often each symbol has appeared. probability.py is a standalone library for considering weighted outcomes.
import collections
import random
from fractions import Fraction
class Outcomes:
"""
Represents a set of possible outcomes along with the probability they'll occur.
Supports the following operations:
outcomes1 * outcomes2: