Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
Makefile | 2021-01-01 | 2.9 kB | |
README.txt | 2021-01-01 | 720 Bytes | |
AppClass.rb | 2021-01-01 | 1.6 kB | |
AppClass.sm | 2021-01-01 | 2.1 kB | |
checkstring.rb | 2021-01-01 | 1.5 kB | |
Totals: 5 Items | 8.9 kB | 0 |
Ruby 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: $ ruby checkstring.rb <string> Try several different strings, such as: $ ruby checkstring.rb "" -> acceptable $ ruby checkstring.rb 000 -> acceptable $ ruby checkstring.rb 00011 -> acceptable $ ruby checkstring.rb 111 -> acceptable $ ruby checkstring.rb 000111100 -> unacceptable $ ruby checkstring.rb 00011a1b10c0 -> unacceptable