From c34a09fc7a828940b756998050b01341fcbae20a Mon Sep 17 00:00:00 2001 From: MCorange Date: Sat, 18 Mar 2023 19:06:03 +0200 Subject: [PATCH] optimise examples/rule110.mcl to match C speed --- examples/rule110.mcl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/rule110.mcl b/examples/rule110.mcl index 0664381..8d10732 100755 --- a/examples/rule110.mcl +++ b/examples/rule110.mcl @@ -3,18 +3,16 @@ mem 98 + 1 @8 0 while dup 98 < do 0 while dup 100 < do dup mem + !8 if - mem 100 + 42 @8 + dup mem + 100 + 42 @8 else - mem 100 + 32 @8 + dup mem + 100 + 32 @8 end - 1 mem 100 + 1 1 syscall3 drop - 1 + end - drop + + mem + 100 + 10 @8 - mem 100 + 10 @8 - 1 mem 100 + 1 1 syscall3 drop + 101 mem 100 + 1 1 syscall3 drop // pattern mem !8 1 shl