Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote-Safe Quines #95

Open
tkellehe opened this issue Jan 27, 2017 · 2 comments
Open

Quote-Safe Quines #95

tkellehe opened this issue Jan 27, 2017 · 2 comments

Comments

@tkellehe
Copy link
Owner

http://codegolf.stackexchange.com/questions/108331/quote-safe-quines

9 bytes

Ḷ1ḥ-Ð1ḥ@€
Ḷ1        # Loops the following code once.
   ḥ-     # Grabs the literal string of the token preceding this token which produces the string "Ḷ" and pushes to the top of the stack.
    Ð     # Pushes the stack (which is an array) to the screen and since it is done by reference, as the stack changes so will what is printed.
     1    # Pushes the literal string "1". This is done because "Ḷ" needs to be "Ḷ1". So, what is printed currently is "Ḷ1".
      ḥ@  # Pushes the literal string "ḥ-Ð1ḥ@€" (essentially this command gets the string of the code based off of the containing scope it is in).
        € # Ends the loop. (currently the stack looks like [ "Ḷ", "1", "ḥ-Ð1ḥ@€"].
          # Top of the stack gets popped off and placed to the screen (which removes it from the array because it is the stack)

My answer

Try it:)

@tkellehe
Copy link
Owner Author

tkellehe commented Jan 27, 2017

7 bytes

Forgot Noodel had a way to loop a given block of code once...

ḷḥ-Ðḥ@ḅ

Try it:)

@tkellehe
Copy link
Owner Author

tkellehe commented Jan 27, 2017

3 bytes

Got a little more clever.

ḥɲ`
ḥ   # Pushes on the string literal "ḥɲ`" onto the stack.
 ɲ` # Ends the program immediately.
    # Implicitly pop off of the top of the stack.

Try it:)

@tkellehe tkellehe added the won label Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant