Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
checkstring.js | 2021-01-01 | 1.8 kB | |
index.html | 2021-01-01 | 672 Bytes | |
Makefile | 2021-01-01 | 2.0 kB | |
README.txt | 2021-01-01 | 741 Bytes | |
AppClass.js | 2021-01-01 | 2.1 kB | |
AppClass.sm | 2021-01-01 | 2.0 kB | |
Totals: 6 Items | 9.3 kB | 0 |
JavaScript Example 2 This state machine "recognizes" the string 0*1*. Example 2 differs from example 1 in that example 2 uses default transitions. + Building ---------- NOTE: Smc.jar must be built and installed. Unix & Windows: $ make checkstring + Executing ----------- Unix & Windows: $ nodejs checkstring.js <string> Try several different strings, such as: $ nodejs checkstring.js "" -> acceptable $ nodejs checkstring.js 000 -> acceptable $ nodejs checkstring.js 00011 -> acceptable $ nodejs checkstring.js 111 -> acceptable $ nodejs checkstring.js 000111100 -> unacceptable $ nodejs checkstring.js 00011a1b10c0 -> unacceptable