Created
November 4, 2016 20:07
-
-
Save blippy/8abfb315b45d1b3becb6dfe82ac5cd39 to your computer and use it in GitHub Desktop.
Simple pattern matching with Snobol4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inp = 'baz,F.bar,go,F.mAgic' | |
| ALPHAS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
| myloop inp ('F.' SPAN(ALPHAS)) . hit REM . inp :F(finis) | |
| output = 'Computer says:' hit :(myloop) | |
| finis output = 'Finished' | |
| END |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run using
snobol4 -b spat.snoOutput is
The code is discussed by me in a Wordpress article.