01-02-2004, 07:48 AM
You can do it.
A FSM is a Finite State Machine. Once the FSM is hardcoded (in an array, for example) a FSM interpreter can be done in 10 lines of code. You just have to check for the state where you are and the symbol coming (one at a time) and jumping to a new state depending on it.
Note that I said that the FSM interpreter will take 10 lines of code. Of couse you need more lines to check if the input file exists, opening files, and doing misc stuff.
A FSM is a Finite State Machine. Once the FSM is hardcoded (in an array, for example) a FSM interpreter can be done in 10 lines of code. You just have to check for the state where you are and the symbol coming (one at a time) and jumping to a new state depending on it.
Note that I said that the FSM interpreter will take 10 lines of code. Of couse you need more lines to check if the input file exists, opening files, and doing misc stuff.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i