Skip to content

Instantly share code, notes, and snippets.

View MRGRAVITY817's full-sized avatar
🌃
watching a night sky

Hoon Wee MRGRAVITY817

🌃
watching a night sky
View GitHub Profile
@MRGRAVITY817
MRGRAVITY817 / lib.rs
Created September 8, 2022 14:57
Bowling Game
pub struct Game {
score: u32,
rolls: Vec<u32>,
}
impl Game {
pub fn new() -> Game {
Game {
score: 0,
rolls: vec![],
@MRGRAVITY817
MRGRAVITY817 / main.rs
Last active June 21, 2022 02:58
State machine template built with Rust
use std::marker::PhantomData;
struct Reserved;
struct Cooking;
struct Delivering;
struct Arrived;
struct FoodDelivery<State = Reserved> {
state: PhantomData<State>,
}