Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.txt | 2021-01-01 | 736 Bytes | |
AppClass.sm | 2021-01-01 | 2.1 kB | |
checkstring.py | 2021-01-01 | 1.5 kB | |
Makefile | 2021-01-01 | 2.7 kB | |
AppClass.py | 2021-01-01 | 1.7 kB | |
Totals: 5 Items | 8.8 kB | 0 |
Python 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: $ python checkstring.py <string> Try several different strings, such as: $ python checkstring.py "" -> acceptable $ python checkstring.py 000 -> acceptable $ python checkstring.py 00011 -> acceptable $ python checkstring.py 111 -> acceptable $ python checkstring.py 000111100 -> unacceptable $ python checkstring.py 00011a1b10c0 -> unacceptable