I made a cursed thing 😂

pull/1/head
Alex Bethel 2021-12-07 14:24:58 -07:00
parent bc3f16ba40
commit b23963137a
1 changed files with 10 additions and 1 deletions

View File

@ -206,7 +206,16 @@ impl Value {
params: vec![],
},
Value::Str(s) => Functio::Eval(s),
Value::Int(_) => todo!(),
Value::Int(i) => Functio::BfFunctio {
instructions: {
let instruction_mappings = [b'[', b']', b'+', b'-', b',', b'.', b'<', b'>'];
std::iter::successors(Some(i), |i| Some(i >> 3))
.take_while(|&i| i != 0)
.map(|i| instruction_mappings[(i & 0x07) as usize])
.collect()
},
tape_len: crate::brian::DEFAULT_TAPE_SIZE_LIMIT,
},
Value::Bool(_) => todo!(),
Value::Abool(_) => todo!(),
Value::Functio(f) => f,