mindustry logic execution, map- and schematic- parsing and rendering
| -rw-r--r-- | lemu/src/instructions/mop.rs | 11 | ||||
| -rw-r--r-- | lemu/yes.mlog | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lemu/src/instructions/mop.rs b/lemu/src/instructions/mop.rs index 7a9a4d7..715cd3d 100644 --- a/lemu/src/instructions/mop.rs +++ b/lemu/src/instructions/mop.rs @@ -29,6 +29,11 @@ macro_rules! num { f64::from($c(get_num!(x).to_radians())) } }; + (to_deg $fn: ident $c:expr) => { + fn $fn(x: &LVar<'_>) -> f64 { + f64::from($c(get_num!(x))).to_radians() + } + }; } macro_rules! flbop { @@ -51,9 +56,9 @@ num!(sqrt f64::sqrt); num!(deg sin f64::sin); num!(deg cos f64::cos); num!(deg tan f64::tan); -num!(deg asin f64::asin); -num!(deg acos f64::acos); -num!(deg atan f64::atan); +num!(to_deg asin f64::asin); +num!(to_deg acos f64::acos); +num!(to_deg atan f64::atan); num!(log10 f64::log10); super::op_impl!(MathOp1, ptr type = for<'v> fn(&LVar<'v>) -> f64 { diff --git a/lemu/yes.mlog b/lemu/yes.mlog index 3efea3f..7186860 100644 --- a/lemu/yes.mlog +++ b/lemu/yes.mlog @@ -1,2 +1,4 @@ -print "yes\n" -jump 0 always +set a 1 +select result notEqual x false a 2 +print result +printflush message1 |