ruby-uebungen/Assignment_029/solution/readme.md

6 lines
179 B
Markdown
Raw Permalink Normal View History

2023-05-25 17:47:19 +02:00
# Lösung: Quine
2023-05-23 09:19:31 +02:00
2023-05-25 17:49:42 +02:00
```ruby
2023-05-25 17:47:19 +02:00
p = "p = \"%s\"; puts p %% [ p.gsub(/[\"\\\\]/, '\"' => '\\\"', '\\\\' => '\\\\\\\\') ]"; puts p % [ p.gsub(/["\\]/, '"' => '\\"', '\\' => '\\\\') ]
2023-05-23 09:19:31 +02:00
```