fix Makefile and README.md for 2012/hou

Help patho.pl find perl and make executable.
This commit is contained in:
Landon Curt Noll committed 2023-03-23 22:50:05 -07:00
1 parent 06fc780ce5
commit b73f7c2469
3 files changed
+244 -109

No files matched your search

+32 -28
View File
@@ -1,53 +1,58 @@
# Most useful obfuscation
Qiming Hou
<hqm03ster@gmail.com>
<http://www.houqiming.net>
Qiming Hou
<hqm03ster@gmail.com>
<http://www.houqiming.net>
# To build:
## Judges' comments:
### To build:
make hou
```sh
make
```
### To run:
./hou syntax-file file-to-process
```sh
./hou syntax-file file-to-process
```
### Try (Unix):
### Try:
The results are best viewed in a 80x25 console with ANSI colors.
```sh
less hou.c
less hou.c
./hou ansi.txt hou.c | less -r
./hou ansi.txt hou.c | less -r
./hou chk.txt hou.c | wc
./hou chk.txt hou.c | wc
./hou markdown.txt remarks.markdown > remarks.htm
```
./hou markdown.txt remarks.markdown > remarks.htm
your-browser remarks.htm
View the `remarks.htm` file in your web browser.
The result is best viewed in a 80x25 console with ANSI colors.
### Try (Windows):
copy header.htm hou.htm /y
hou html.txt hou.c >> hou.htm
start hou.htm
```sh
copy header.htm hou.htm /y
hou html.txt hou.c >> hou.htm
start hou.htm
```
### Selected Judges Remarks:
## Judges' comments:
What a versatile entry! It can be used to check the size of IOCCC entries *and* to publish them as HTML.
For extra credit: what is the meaning of the number 2321237?
## Author's comments:
### Disclaimer
The reviewer may have already noticed that the 2nd page of this program is a dense blob, which is discouraged by the contest rules. We wish to point out that a majority of state-of-art programming editors support syntax highlighting, which should be enabled when reading this entry. Anticipating that the reviewer's preferred color setting may produce a suboptimal visual effect, a few syntax files are provided to highlight the source code under an author-provided setting, using the submitted program itself. Syntax highlighting would also visually improve the 3rd page.
The reviewer may have already noticed that the 2nd page of this program is a dense blob, which is discouraged by the contest rules. We wish to point out that a majority of state-of-art programming editors support syntax highlighting, which should be enabled when reading this entry. Anticipating that the reviewer's preferred color setting may produce a suboptimal visual effect, a few syntax files is provided to highlight the source code under an author-provided setting, using the submitted program itself. Syntax highlighting would also visually improve the 3rd page.
The code may throw a few warnings due to formating constraints. The author did try to remove warnings under gcc and Visual Studio, though.
The code may throw a few warnings due to formatting constraints. The author did try to remove warnings under gcc and Visual Studio, though.
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.
@@ -55,7 +60,7 @@ The author does not own the original anime series where the embedded ASCII arts
The syntax file consists of a number of rewriting rules. Each rule consists of a regular expression, a space, a format string, and a newline. All text matching the regular expression would be replaced by the format string. In case of a conflict, rules appearing earlier would take precedence. One can refer to the original text in the format string using "%s". Other "%" characters in the format string must be escaped with another "%". The space character can be used in the regular expression by escaping it with [] or "".
The following regular expression operators are supported:
The following regular expression operators is supported:
() [] * + ? | ""
@@ -82,7 +87,7 @@ Finally, there are a few limitations...
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 preprocessor may remove the former, the later would remain regardless of beautification and preprocessing.
The second layer of obfuscation comes from the need to squeeze a reasonably powerful regex engine into the remaining area that isn't occupied by excessive keywords and useless constants. To achieve this, the regex compiler is written using the same threaded virtual machine [1] that parses the regex. Due to compiler limitations, the generated VM code also ends up obscured by a large amount of spaghetti branches and virtual thread creations. Finally, the VM in [1] is extended to track multiple expression matches for the actual formating.
The second layer of obfuscation comes from the need to squeeze a reasonably powerful regex engine into the remaining area that isn't occupied by excessive keywords and useless constants. To achieve this, the regex compiler is written using the same threaded virtual machine [1] that parses the regex. Due to compiler limitations, the generated VM code also ends up obscured by a large amount of spaghetti branches and virtual thread creations. Finally, the VM in [1] is extended to track multiple expression matches for the actual formatting.
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.
@@ -92,11 +97,10 @@ As an extra tweak, the text message actually does something useful. Remove the "
[2] [Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)](http://swtch.com/~rsc/regexp/regexp1.html)
--------------------------------------------------------------------------------
<!--
## Copyright:
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
[judges]: http://www.ioccc.org/judges.html
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
-->