add: whatever I had

This commit is contained in:
Charles
2025-10-20 21:48:53 -07:00
parent 49b81c7d97
commit 7bb5109751
41 changed files with 424 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "dice-sim"
version = "0.1.0"
+6
View File
@@ -0,0 +1,6 @@
[package]
name = "dice-sim"
version = "0.1.0"
edition = "2021"
[dependencies]
+27
View File
@@ -0,0 +1,27 @@
// Stores something like 1d6
pub struct DiceExpr {
count: usize,
dice: usize,
}
type Op2 = (Box<Expr>, Box<Expr>);
type Op1 = DiceExpr;
type PResult<'a, R> = Result<(R, &'a [char]), String>;
pub enum Expr {
Add(Op2),
Sub(Op2),
Const(Op1),
}
fn take_while<'a>(expr: &'a [char]) -> PResult<'a, usize> {
fn take_int<'a>(expr: &'a [char]) -> PResult<'a, usize> {
unimplemented!()
}
pub fn parse<'a>(expr: &'a [char]) -> PResult<'a, Expr> {
unimplemented!()
}
+3
View File
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}