Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@RandyMcMillan
RandyMcMillan / rust_core.rs
Last active July 19, 2026 13:08 — forked from rust-play/playground.rs
rust_core.rs
#![allow(deprecated)]
//#![feature(cfg_select, assert_matches)]
use std::assert_matches;
use rand_0_8_6::{thread_rng as rng_legacy, Rng as RngLegacy};
use rand_0_9_4::{thread_rng as rng_latest, Rng as RngLatest};
use num_bigint::BigUint;
use chrono::Local;
@RandyMcMillan
RandyMcMillan / circle_tones.rs
Last active July 15, 2026 21:21 — forked from rust-play/playground.rs
circle_tones.rs
//// Coltrane's Circle of Tones
// Written using only the Rust Standard Library.
use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Note {
C, Db, D, Eb, E, F, Gb, G, Ab, A, Bb, B,
}
@RandyMcMillan
RandyMcMillan / .gitignore
Last active July 15, 2026 16:55 — forked from rust-play/playground.rs
red_level.rs
Cargo.lock
@RandyMcMillan
RandyMcMillan / query.sql
Created July 14, 2026 02:13 — forked from coreh/query.sql
Top 1000 github users
SELECT count(*) as activity, actor_attributes_login FROM publicdata:samples.github_timeline WHERE actor_attributes_login != '' GROUP BY actor_attributes_login ORDER BY activity DESC LIMIT 1000;
@RandyMcMillan
RandyMcMillan / bool_slice.rs
Last active July 12, 2026 12:04 — forked from rust-play/playground.rs
bool_slice.rs
//! Proving and verifying Boolean function $v$-slices with integer inner products.
//! References: "Slicing Boolean Functions with Inner Products"
use std::collections::BTreeMap;
/// Evaluates a standard linear form $\langle v, x \rangle$ over the integers,
/// where $v \in \mathbb{Z}^n$ and $x \in \mathbb{F}_2^n$.
pub fn compute_inner_product(v: &[i32], x: u32, n: usize) -> i32 {
let mut ip = 0;
for i in 0..n {
@RandyMcMillan
RandyMcMillan / .gitignore
Last active July 11, 2026 15:36 — forked from PurredCoffee/main.rs
Rust wry UI & compute thread communication
/target
@RandyMcMillan
RandyMcMillan / phi_faucet.rs
Last active July 10, 2026 02:14 — forked from rust-play/playground.rs
phi_faucet.rs
// A "faucet" that drips out approximations of Phi using nested radicals:
// x_{n+1} = sqrt(1 + x_n)
struct NestedRadicalFaucet {
current: f64,
}
impl NestedRadicalFaucet {
fn new() -> Self {
// Start with the outermost 1 (before any square roots are applied)
NestedRadicalFaucet { current: 1.0 }
@RandyMcMillan
RandyMcMillan / game_theory_2.rs
Last active July 7, 2026 13:48 — forked from rust-play/playground.rs
game_theory_2.rs
// =========================================================================
// CORE TYPES & TRAIT
// =========================================================================
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Move {
Cooperate,
Defect,
}
@RandyMcMillan
RandyMcMillan / game_theory.rs
Last active July 7, 2026 13:47 — forked from rust-play/playground.rs
game_theory.rs
// =========================================================================
// CORE TYPES & TRAIT
// =========================================================================
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Move {
Cooperate,
Defect,
}
@RandyMcMillan
RandyMcMillan / prisoners_dilemma.rs
Last active July 7, 2026 13:26 — forked from rust-play/playground.rs
prisoners_dilemma.rs
use std::fmt;
/// The two possible moves a player can make in the Prisoner's Dilemma.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Move {
Cooperate,
Defect,
}
/// Represents a game-theoretic strategy.