Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 689633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:21:09+00:00 2026-05-14T02:21:09+00:00

Just finished reading this blog post: http://www.skorks.com/2010/03/an-interview-question-that-prints-out-its-own-source-code-in-ruby/ In it, the author argues the case

  • 0

Just finished reading this blog post: http://www.skorks.com/2010/03/an-interview-question-that-prints-out-its-own-source-code-in-ruby/

In it, the author argues the case for using a quine as an interview question. I’m not sure I agree but thats not what this question is about.

He goes on to construct a quine in Ruby and refactor it to make it shorter. He then challenges the reader to try to make it even shorter.

I played around with it for a while and came up with the following:

s="s=;puts s[0,2]+34.chr+s+34.chr+s[2,36]";puts s[0,2]+34.chr+s+34.chr+s[2,36]

This is the first time I have ever attempted a quine and I can’t figure out how to make it any shorter.

What is the shortest Ruby quine you can come up with? Please post an explanation if your implementation requires it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:21:09+00:00Added an answer on May 14, 2026 at 2:21 am

    Unfortunately RubyGarden doesn’t exist anymore. Here are a couple of links to make up for it (the one Kevin posted is not the shortest one anymore by the way):

    The first quines in Ruby

    s="s=%c%s%c; printf s,34,s,34,10%c"; printf s,34,s,34,10
    

    ruby quine slightly smaller than python quine

    _="_=%p;puts _%%_";puts _%_
    

    shortest nozero [sic!] ruby quine

    puts <<2*2,2
    puts <<2*2,2
    2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just finished reading Mike's awesome tutorial over at: http://www.mikesdotnetting.com/Article/150/Web-Pages-Efficient-Paging-Without-The-WebGrid and I am using
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I just finished looking at this question: https://stackoverflow.com/questions/753122/which-cloud-computing-platform-should-i-choose But, I am not certain what
Just finished reading the latest stackoverflow blog post about moving static content to a
Just finished reading Jon Skeet's article about events and delegates and got a question.
I just finished reading the HTML5 Developer's Cookbook and have a question. I've read
I've just finished reading up on the CustomValidator control and I have a question.
After reading this SO question and noting the consensus about just how evil Thread.Sleep()
I just finished reading Restful Web Services and Nobody Understands REST or HTTP and
I am just about finished reading K&R, and that is all the C that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.