Ruby Quine
Ich hab mich mal an einem Quine in Ruby versucht:
def print a puts a, "print %s(#{a})" end print %s(def print a puts a, "print %s(#{a})" end)
Ist zwar nicht das kürzeste, aber dafür lesbar.
Sonst noch jemand? Fürs ausprobieren empfehle ich: ruby q.rb | diff -u q.rb -
Bonusfrage: Welches Buch lese ich im Moment wohl?
Leave a comment
You must be connected to write a comment.

