The forum code highlighter now supports Forth! Code: : EDUARDO ( -- ) ." You rlly like Eduardo" CR ; : SORT ( -- ) BEGIN \ output current item info 20 SORTADDR ! 0 SORTSLOT@ ( quantity ) DROP ( LSB ) 22 IOXADDR ! IOX! ( MSB ) 21 IOXADDR ! IOX! \ check input to see whether we need to send 3 IOXADDR ! IOX@ DUP DUP DUP 1 AND IF EDUARDO 0 SORTPULL ( pull out item ) 2/ 31 AND SORTADDR ! 6 U>> 15 AND SORTCOLOR! 10 U>> 255 AND SORTMATCH ELSE DROP DROP DROP THEN AGAIN ;
Nice work, sk. This is a bit off topic, but is Forth as complicating as it looks? I can understand jackshit about that code up there.
It's only hard when you can't read it. It's a stack-based language, i.e. there is a stack where data, etc. goes, and all of the words there are like commands with code behind them that use the data on the stack to get the information that they need to run. A good tutorial is: www.forth.com/starting-forth/
The declaration of different parts in the code (such as the following: : EDUARDO) Makes me think of Assembly language, my main one