Coder Social home page Coder Social logo

dr_quine's Introduction

Dr Quine

An introduction to Quines and Virus

Challenge

The following 3 programs in C, ASM, and Python:

  • Colleen - Print my source code

  • Grace - Clone myself, spawning my kid

  • Sully - Self-replicate 5 times

See the subject for more details.

Final Score 125/100

Getting Started

Clone this repo.
git clone https://github.com/dfinnis/Dr_Quine.git

For ASM/ you may need to install nasm.
brew install nasm

In C/ and ASM/ first make the binaries.
make

Then run the binaries.
./Colleen, ./Grace & ./Sully

In Python/ run files directly.
python Colleen.py, python Grace.py & python Sully.py

Examples

Let's demo the python examples:

Colleen

Print my source code.

Run Colleen and compare the output with the source code. This diff should output nothing, showing output and source code are identical.

python Colleen.py > tmp_Colleen ; diff tmp_Colleen Colleen.py

Grace

Clone myself, spawning my kid.

Run Grace and compare Grace with Grace_kid. This diff should output nothing, showing Grace and Grace_kid are identical.

python Grace.py; diff Grace.py Grace_kid.py

Sully

Self-replicate 5 times.

Run Sully and compare Sully with clones. The following command should show the only difference is number.

python Sully.py; diff Sully.py Sully_5.py; diff Sully.py Sully_4.py; diff Sully.py Sully_3.py; diff Sully.py Sully_2.py; diff Sully.py Sully_1.py; diff Sully.py Sully_0.py

Tests

The test scripts run the steps shown above for each language, ensuring output/clones are identical to source code.

./test_all.sh

Dependencies

  • Python 3.9.1 (no requirements.txt necessary)
  • NASM 2.14.02

dr_quine's People

Contributors

anyaschukin avatar ekelen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

sanchezcarlosjr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.