Skip to content

Instantly share code, notes, and snippets.

View peter-lang's full-sized avatar

Peter Lang peter-lang

View GitHub Profile
@peter-lang
peter-lang / await_deconstructed.rs
Created June 27, 2024 17:48
Deconstructing awaits
use std::rc::Rc;
use std::thread::sleep;
use std::time::{Duration, SystemTime};
#[derive(Clone)]
enum AwaitState<T> {
Uninitialized,
Running,
Complete(T),
}
import struct
import tqdm
# states:
# neutral: 0
# player1: 1, 2, 3 (have 2 of each)
# player2: -1, -2, -3 (have 2 of each)
# board: 3x3 => 9 long tuple (board[i][j] = tuple[i*3 + j])
# Rotations