Finally got caught up to SB without an Eval function so looks a bit like assembly and ei for ElseIf does work, at least in my first test. That syntax is god awful, half my errors are missed ticks for variables and another half using a comma instead of semi-colon to divide arguments. The Program map of loops, labels and if block markers is big help.
So going to convert everything over to:
Command space var|arg, arg, arg+chr$13+chr$10 <Notepad++ insists
comma and space for readability, so no spaces in the command but all you want there after.
So flipping code and shortening WIP name Simple Interpreter to Interpreter.
Oh wait variables still need to be distinguished from literals. Well there's no use fighting habits, literals to start with "
I'm thinking a line editor can add space after commas and trim variables on both side and literal left of ".
Probably use a ' comment symbol to tell exec not to look for commands on that line.
Sample of Test 6 for ei command:
Test 6 the New ei command.txt b+ 2021-02-12 ei AKA ElseIf
., Let's examine the common factors of some numbers:
.,
[,
.,
?,num; Please enter a number to test >
<,<2;'num;2
i,'<2
x,
e,
%,Nmod2;'num;2
=,Even;'Nmod2;0
%,Nmod3;'num;3
=,Triple;'Nmod3;0
%,Nmod5;'num;5
=,Pentacle;'Nmod5;0
%,Nmod7;'num;7
=,Septacle;'Nmod7;0
i,'Even
., ;'num; is Even.
ei,'Triple
., ;'num; is Triple.
ei,'Pentacle
., ;'num; is Pentacle.
ei,'Septacle
., ;'num; is Septacle.
e,
+,Remaining;1;-.5;-.1667;-.0333;-.0048
., The probability of ;'num; not being factorable by 2,3,5,7 is;'Remaining
f,
f,
],
.,
., Thanks for playing.
Quick convert program
Commas to spaces, ; to comma + space, swap ' for space and no ' for ", easy :)