Add try.sh and hint.md to 2012/hou + formatting
The hint.md file is necessary as the '#' header in it specifies the title and stylesheet as part of the entry. The try.sh script is as usual. Format/typo check README.md file. The hint.md file formatting was not changed due to the regexp engine amongst other reasons. Just obvious spelling errors were updated.
This commit is contained in:
1 parent
484970b11c
commit
bb1ac2484d
4 files changed
+195
-13
No files matched your search
+13
-13
@@ -15,22 +15,17 @@ make
|
||||
### Try:
|
||||
|
||||
```sh
|
||||
less hou.c
|
||||
|
||||
./hou ansi.txt hou.c | less -r
|
||||
|
||||
./hou chk.txt hou.c | wc
|
||||
|
||||
./hou markdown.txt README.md > remarks.htm
|
||||
./try.sh
|
||||
```
|
||||
|
||||
View the `remarks.htm` file in your web browser.
|
||||
|
||||
The result is best viewed in a 80x25 console with ANSI colors.
|
||||
|
||||
|
||||
## Try (Windows):
|
||||
|
||||
```sh
|
||||
```
|
||||
copy header.htm hou.htm /y
|
||||
hou html.txt hou.c >> hou.htm
|
||||
start hou.htm
|
||||
@@ -65,6 +60,7 @@ The author does not own the original anime series where the embedded ASCII arts
|
||||
come from. For comparison, original non-ASCII art depictions of the relevant
|
||||
characters and objects can be found by googling the embedded text messages.
|
||||
|
||||
|
||||
### Syntax files
|
||||
|
||||
The syntax file consists of a number of rewriting rules. Each rule consists of a
|
||||
@@ -81,9 +77,10 @@ The following regular expression operators are supported:
|
||||
() [] * + ? | ""
|
||||
```
|
||||
|
||||
For example, one can use the following expression to match a certain declaration statement in hou.c:
|
||||
For example, one can use the following expression to match a certain declaration
|
||||
statement in [hou.c](hou.c):
|
||||
|
||||
```
|
||||
```re
|
||||
"char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;
|
||||
```
|
||||
|
||||
@@ -93,10 +90,11 @@ hang for the competing Perl engine while matching itself. Try to compare these
|
||||
two engines:
|
||||
|
||||
```sh
|
||||
./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt
|
||||
./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt
|
||||
```
|
||||
|
||||
|
||||
### Limitations
|
||||
|
||||
Finally, there are a few limitations...
|
||||
@@ -108,12 +106,13 @@ Finally, there are a few limitations...
|
||||
- Incorrect syntax files are not tolerated.
|
||||
- The program relies on ASCII.
|
||||
|
||||
|
||||
### Why obfuscated
|
||||
|
||||
The first layer of obfuscation comes from the challenge of embedding a large
|
||||
ASCII art in a dense blob. The entire art is composed using only keywords,
|
||||
strings and character constants. That results in a number of otherwise useless
|
||||
defines and quite a number of unconventionally written constants. While the
|
||||
`#define`s and quite a number of unconventionally written constants. While the
|
||||
preprocessor may remove the former, the later would remain regardless of
|
||||
beautification and preprocessing.
|
||||
|
||||
@@ -128,6 +127,7 @@ amount of spaghetti branches and virtual thread creations. Finally, the VM in
|
||||
As an extra tweak, the text message actually does something useful. Remove the
|
||||
"Make a contract with me" catch line and the program would cease to function.
|
||||
|
||||
|
||||
### References
|
||||
|
||||
[1][Russ Cox, Regular Expression Matching: the Virtual Machine Approach](http://swtch.com/~rsc/regexp/regexp2.html)
|
||||
|
||||
Reference in new issue
Block a user