| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| AppClass.js | 2023-02-20 | 2.2 kB | |
| AppClass.sm | 2023-02-20 | 2.9 kB | |
| checkstring.js | 2023-02-20 | 1.8 kB | |
| index.html | 2023-02-20 | 672 Bytes | |
| Makefile | 2023-02-20 | 2.1 kB | |
| README.txt | 2023-02-20 | 881 Bytes | |
| Totals: 6 Items | 10.4 kB | 0 | |
Lua Example 3
This state machine "recognizes" the palindromes (words that read the
same backwards as forwards). The words consist of the alphabet
{0, 1, c} where the letter 'c' may appear only once and marks the
words center.
+ 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 ""
-> unacceptable
$ nodejs checkstring.js 00
-> unacceptable
$ nodejs checkstring.js 1c
-> unacceptable
$ nodejs checkstring.js c0
-> unacceptable
$ nodejs checkstring.js abcba
-> unacceptable
$ nodejs checkstring.js 110010c010011
-> acceptable
$ nodejs checkstring.js 110010c110010
-> unacceptable