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
0
1k
Rubyで簡単♪Quineの作り方
ゆるふわRuby勉強会Chofu.rb(おためし版)(
http://connpass.com/event/17259/
)で発表したものです。
完成が間に合いませんでした。
けんぼー
July 26, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
AIでLINEスタンプを作ってみた
eycjur
1
230
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
450
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.4k
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
240
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.5k
How Android Uses Data Structures Behind The Scenes
l2hyunwoo
0
470
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.3k
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
1.8k
The Past, Present, and Future of Enterprise Java with ASF in the Middle
ivargrimstad
0
140
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.4k
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
240
Testing Trophyは叫ばない
toms74209200
0
880
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
The Cult of Friendly URLs
andyhume
79
6.6k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Documentation Writing (for coders)
carmenintech
74
5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
How STYLIGHT went responsive
nonsquared
100
5.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Designing Experiences People Love
moore
142
24k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
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作ろう。
文字を追加してみる