fix Makefile and README.md for 2015/muth

This commit is contained in:
Landon Curt Noll committed 2023-03-24 21:10:40 -07:00
1 parent 066db2d707
commit 48f690f089
2 files changed
+213 -128

No files matched your search

+28 -19
View File
@@ -1,33 +1,43 @@
# Most Complete Use of CPP
Dominik Muth <muth.ioccc@freenet.de>
Dominik Muth
<muth.ioccc@freenet.de>
# To build:
## Judges' comments:
### To use:
```sh
make
```
make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run
### To run:
```sh
make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run
```
### Try:
make -B V=2 run
```sh
make -B V=2 run
strings prog | grep '(,)'
strings prog | grep '(,)'
make -B MACHINE=machine_times2.h TAPE=tape_five.h V=1 run
make -B MACHINE=machine_times2.h TAPE=tape_five.h V=1 run
make -B MACHINE=machine_chaos_5_2.h X=5 run
make -B MACHINE=machine_chaos_5_2.h X=5 run
```
### Selected Judges Remarks:
## Judges' comments:
This is something we were fearing all along: that the C preprocessor is Turing-complete
even without conditionals and recursive file inclusion as some kind of a
[rewriting system](https://en.wikipedia.org/wiki/Rewriting). Now we have the proof!
## Author's comments:
### Preprocessor Turing Engine
#### Features
### Features
- Turing machine runs in preprocessor
- universal (unlimited configurable states, symbols, and tape)
@@ -42,19 +52,19 @@ even without conditionals and recursive file inclusion as some kind of a
- make target `run` runs `./prog` and filters a little statistics out of the verbose output
- `X` (defaults to 3) sets the maximum number of steps: *M*(`X`) ~ 8<sup>`X`</sup>
#### Limitations
### Limitations
If the machine does not halt after *M*(`X`) steps, you will see unexpanded macros in the output.
#### Compiler warnings
### Compiler warnings
If `V=1` or `V=2` is used, you may see "`warning: string length is greater than the length '4095' ISO C99 compilers are required to support`".
#### Programming
### Programming
Implementing your own Turing machine is easy. Take a look at the supplied header files for examples.
##### Tape Symbols
#### Tape Symbols
Every symbol used (except "`_`") must be explicitly declared using
@@ -64,7 +74,7 @@ Example:
#define sym_1(sym, _1) sym
##### Tape
#### Tape
The initial content of the tape must be defined in the tape header using a triple like:
@@ -76,7 +86,7 @@ The initial content of the tape must be defined in the tape header using a tripl
The empty pairs "`(,)`" represent the continuations of the tape, filled with underscore symbols ("`_`"). They are expanded on demand.
##### State Machine
#### State Machine
All transitions are defined in the machine header using the syntax
@@ -97,11 +107,10 @@ To halt the machine, use the keyword "`break`" as in
#define A_1 (2, break)
--------------------------------------------------------------------------------
<!--
## Copyright:
(c) Copyright 1984-2016, [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/
-->