Skip to content

Instantly share code, notes, and snippets.

@initzx
initzx / gausselimination.py
Last active October 31, 2022 09:20
An algorithm to generate LaTeX Gaussian-eliminations
from enum import Enum
from fractions import Fraction
import numpy as np
def override_str(self):
if self._denominator == 1:
return str(self._numerator)
else:
@initzx
initzx / arithmetic_game.py
Created March 18, 2022 10:49
Simple arithmetic game
#!/usr/bin/python
# Arithmetic game where you have to multiply numbers in your head
# Choose up to n digits
# Ideas for game
# More digits as you progress, game gets harder incrementally
# Encode numbers a and b as 2x10 2,13,4x10 or 7-8x10
# - Recursively parse 2-9,45-29x2
# Hints after periods of inactivity, for example if asked to multiply 68x92, then a hint could be 90x8=720