Context
We defined what a multiquine is, and picked 3 languages (C#, JS and BF).Now, let's build our multiquine.
As a reminder, when building a simple quine, we stated that a quine needs 2 parts:
- The data
- The code
Code's goal is to write data definition, based on data contents, then write code, again based on data contents
And data is written afterwards, when code is completed, based on code source code.
To make things a bit more clear, let's introduce a third part (actually, the first one in our source codes): the bootstrap.
The bootstrap will be some static source code, written before data declaration.
Then, to build a multiquine:
Then, to build a multiquine:
- Write the bootstrap
- Declare data (leaving some blanks to be filled later) for each language
- Write code
- For a given language L (passed as program argument)
- Write target bootstrap
- Declare data the way it should be declared in language L
- Note: declare data for all languages
- Write code based on specific data related to language L
Aucun commentaire:
Enregistrer un commentaire