Giter Club home page Giter Club logo

grizzly-quines's Introduction

Grizzly-Quines

Inspiration

I'm proud to say that GrizzHacks 5 is my first GrizzHacks hackathon. It is such a pleasure to experience the thrill and excitement as did my other friends who have experienced previous GrizzHacks hackathons. In commemoration, my teammate and I decided to build one of our favorite quirks in programming: quines that are shaped into something.

What it does

Basically, a quine is a "self replicating" program that takes in no input, and outputs itself. Here, I took the GrizzHacks bear mascot and converted it into ascii and put it inside the quine and made it print itself in the terminal. You can see all the code and the final image in the terminal just by running the python program. It's that simple.

How I built it

A quine is classified as a program that takes no input and outputs a quine. However, a quine should not use any 'open()' function to print out its source code, rather it must print out its own code via print statements or otherwise. Using an 'open()' function would be considered cheating, in a sense. What I did was took the ascii image of the GrizzHacks mascot and put inside a string. Then, I tried to work out the character escapes and notation inside the string to be printed, so that it can print itself. This is perhaps one of the easiest ways to create a quine: to define a string, then put the string inside itself with string formatting. Unobfuscated, you can clearly see the GrizzHacks bear mascot as well as the code used to make it. Of which, include the character escapes, the string that is printed, and the variable storing that string.

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.