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
CSC305 Lecture 08
javiergs
PRO
0
210
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
500
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
340
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
2
500
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
1k
Serena MCPのすすめ
wadakatu
4
1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
140
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
CSC509 Lecture 05
javiergs
PRO
0
300
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
530
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
27
2k
Context Engineering - Making Every Token Count
addyosmani
6
260
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
4 Signs Your Business is Dying
shpigford
185
22k
A better future with KSS
kneath
239
18k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Building Applications with DynamoDB
mza
96
6.7k
Statistics for Hackers
jakevdp
799
220k
We Have a Design System, Now What?
morganepeng
53
7.8k
Building an army of robots
kneath
306
46k
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作ろう。
文字を追加してみる