| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.txt | 2023-02-20 | 740 Bytes | |
| AppClass.php | 2023-02-20 | 2.1 kB | |
| AppClass.sm | 2023-02-20 | 2.1 kB | |
| checkstring.php | 2023-02-20 | 1.5 kB | |
| Makefile | 2023-02-20 | 2.2 kB | |
| Totals: 5 Items | 8.6 kB | 0 | |
PHP 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:
$ php -q checkstring.php <string>
Try several different strings, such as:
$ php -q checkstring.php ""
-> acceptable
$ php -q checkstring.php 000
-> acceptable
$ php -q checkstring.php 00011
-> acceptable
$ php -q checkstring.php 111
-> acceptable
$ php -q checkstring.php 000111100
-> unacceptable
$ php -q checkstring.php 00011a1b10c0
-> unacceptable