Skip to content

Instantly share code, notes, and snippets.

@DonSheddow
DonSheddow / montecarlo.py
Created March 20, 2024 14:59
Ann's problem
from math import comb
import sys
import random
s1, s2, s3, s4 = 10, 11, 12, 13
h = 7
N = s1 + s2 + s3 + s4
def generate_deck():
deck = s1*[1] + s2*[2] + s3*[3] + s4*[4]
@DonSheddow
DonSheddow / test.nu
Created January 7, 2024 20:55
Simple script to check math functions using various inputs
let range = 1..5
let rec = {a: 1, b: 2}
let table = [[a b]; [1 2] [3 4]]
let durations = [1sec 1min]
let filesizes = [100b 1kb]
print "\n ### avg ###"
print ($range | math avg)
print ($rec | math avg)
print ($table | math avg)
#!/usr/bin/env rust-script
//! ```cargo
//! [dependencies]
//! indicatif="0.17.3"
//! ```
use std::env;
use std::fs::File;
use std::io::{self, BufRead}; // BufRead provides .lines() trait for BufReader
use std::path::Path;
@DonSheddow
DonSheddow / digit_recognition.ipynb
Last active March 21, 2021 00:02
digit_recognition.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DonSheddow
DonSheddow / all.txt
Last active April 21, 2019 09:18
Jason Haddix's all.txt, but pruned of illegal characters
This file has been truncated, but you can view the full file.
.
..
........
0
0-0
00
0-0-0
000
0000