forked from AbleScript/ablescript
I made a cursed thing 😂
This commit is contained in:
parent
07d021f610
commit
8824633aae
|
@ -206,7 +206,16 @@ impl Value {
|
||||||
params: vec![],
|
params: vec![],
|
||||||
},
|
},
|
||||||
Value::Str(s) => Functio::Eval(s),
|
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::Bool(_) => todo!(),
|
||||||
Value::Abool(_) => todo!(),
|
Value::Abool(_) => todo!(),
|
||||||
Value::Functio(f) => f,
|
Value::Functio(f) => f,
|
||||||
|
|
Loading…
Reference in a new issue