- Status: on going
- Result: -
- Observations: (null)
42 school project.
This project is about discovering the recursion theorem of Kleene! The challenge is to write a program whose output is its own source code. The rules are simple:
- Self-replication: The program’s output must be an exact copy of its source code.
- No peeking: You can’t just open the source file and print its contents. That’s cheating.
- No input: The program must be completely self-contained. It can’t ask for any input to do its job.
Collean: prints its own source code.Grace: outputs its source code to a child file.Sully: outputs its source code toXfiles, whereXis defined in the original source code.
cmake -B build -G "Ninja Multi-Config" .Alternatively, use a Visual Studio generator to create a solution:
# 64-bit
cmake -B build -G "Visual Studio 17 2022" -A x64 .
# 32-bit
cmake -B build -G "Visual Studio 17 2022" -A Win32 .cmake --build build --config ReleaseThe Ninja Multi-Config
generator lets you use other build types (CMAKE_BUILD_TYPE)
like "Debug" or "RelWithDebInfo", apart from "Release".
Asan builds are also supported, they enable the address sanitizer.
The resulting binaries are in build/<build-type>/.
To build and use CMake you can open a developer powershell, or load the
Visual Studio command-line tools by running vcvarsall.bat (locations vary) in your shell:
# 32-bit
path\to\vcvarsall\vcvarsall.bat x86
# 64-bit
path\to\vcvarsall\vcvarsall.bat amd64