Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rubyで簡単♪Quineの作り方
Search
けんぼー
July 26, 2015
Programming
1.1k
0
Share
Rubyで簡単♪Quineの作り方
ゆるふわRuby勉強会Chofu.rb(おためし版)(
http://connpass.com/event/17259/
)で発表したものです。
完成が間に合いませんでした。
けんぼー
July 26, 2015
Other Decks in Programming
See All in Programming
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
1.8k
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
140
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
450
From Formal Specification to Property Based Test
ohbarye
0
2.4k
Explore CoroutineScope
tomoeng11
0
180
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.6k
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.2k
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
430
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
140
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
240
継続的な負荷検証を目指して
pyama86
3
1k
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
3k
Featured
See All Featured
Design in an AI World
tapps
1
210
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
38
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
Unsuck your backbone
ammeep
672
58k
The browser strikes back
jonoalderson
0
1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
290
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
WENDY [Excerpt]
tessaabrams
10
37k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
550
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building the Perfect Custom Keyboard
takai
2
750
Transcript
None
Rubyで簡単♪ Quineの作り方
Quineとは何か ・ 自分自身を出力するプログラム ・ チューリング完全の言語なら何でも出来る (例) ↓ 実行 ↓
基本的な作り方 1. 文字列を変数に代入する 2. 1.を展開して表示させる
イメージ s = 「putsで表示する内容」 puts “s = 「sの内容」\n puts 「sの内容」”
↓ 文字列リテラルとか特殊文字の扱いはどーする?
一行にするとこうなる 1. sに文字列を代入 2. sの内容を実行 a. putsで以下を表示 i. 元のコードの前半と同じ’eval s=’
ii. 変数sを呼び出す iii. inspectメソッドでリテラルを復元 結論:evalってスゴイ、改めてそう思った。
おわり
このままじゃ面白くない ↓ そうだ、AA作ろう。
文字を追加してみる