Skip to content

Instantly share code, notes, and snippets.

@ITR13
ITR13 / impure-vs-pure.cs
Last active February 7, 2025 15:41
Impure vs Pure function example.
class Foo {
private int _someVariable, _someOtherVariable;
void Update() {
DoSomething(); // No way of knowing what this mutates without reading it :(
// The set variables are only used in the same flow
Log(_someVariable, _someOtherVariable);
}
private void Inner() {
@ITR13
ITR13 / buckshot-bruteforce.nim
Last active February 20, 2024 18:29
Finds the optimal move for the player to use against the original dealer AI
import std/tables
import std/hashes
const MaxDepth = 1
type
Item = enum
None, Magnify, Cigarette, Beer, Handcuff, Handsaw
ShootPerson = enum