But... what is a Quine?
A Quine is a program that, when executed, produces its own source code as output.
This project consists of three quines: Colleen, Grace and Sully;
each with unique requirements and behaviour.
The programs are implemented in both C and Nasm (only the first one in Nasm xD),
with separate Makefiles for each language.
.
├── README.md # This file
├── asm/ # Assembly implementations
│ ├── Makefile # Makefile for Assembly projects
│ └── ex00/ # First Assembly quine (Colleen)
│ ├── Colleen.s # Assembly source code
│ └── obj/ # Compiled object files
├── c/ # C implementations
│ ├── Makefile # Makefile for C projects
│ ├── ex00/ # First C quine (Colleen)
│ │ ├── Colleen.c # C source code
│ │ └── obj/ # Compiled object files
│ ├── ex01/ # Second C quine (Grace)
│ │ ├── Grace.c # C source code
│ │ └── obj/ # Compiled object files
│ └── ex02/ # Third C quine (Sully)
│ ├── Sully.c # C source code
│ └── obj/ # Compiled object filesOutput:
Displays its own source code when executed.
Requirements:
- A main function.
- A function declared outside main and called in main.
- Two different comments: One in main and another one outside main.
Output:
Writes its own source code to a file named Grace_kid.c.
Requirements:
- No main function.
- One comment.
- At most three macros
- Program execution is triggered by a macro.
Output:
Writes its own source code to a file named Sully_X.c (where X is an integer),
compiles and runs the new program if X is greater than or equal to 0.
Requirements:
- Contains an integer initialized to 5, which decrements with each iteration.
- Recursively generates and compiles new programs until X is less than 0.
Each language directory (asm and c) contains a Makefile with the following rules:
all/help: Displays available Makefile rules.
build: Compiles the executables for all programs.
clean: Deletes transitive dependencies (object files).
fclean: Deletes object files and executables.
re: Runs fclean followed by build.
test0x: Runs tests for the x exercise (e.g: test00, test01).
test: Runs all tests
Just go into the asm or the c directories and run
make test0X # where X is the exercise numberor, to run all tests:
make test