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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rubyで簡単♪Quineの作り方
ゆるふわRuby勉強会Chofu.rb(おためし版)(
http://connpass.com/event/17259/
)で発表したものです。
完成が間に合いませんでした。
けんぼー
July 26, 2015
Other Decks in Programming
See All in Programming
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
250
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
460
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
150
自作OSでスライド発表する
uyuki234
1
3.8k
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
100
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
110
Contextとはなにか
chiroruxx
1
390
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.8k
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
130
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
220
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
190
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
4 Signs Your Business is Dying
shpigford
187
22k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
340
Why Our Code Smells
bkeepers
PRO
340
58k
Exploring anti-patterns in Rails
aemeredith
3
440
My Coaching Mixtape
mlcsv
0
170
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Unsuck your backbone
ammeep
672
58k
The Curse of the Amulet
leimatthew05
2
13k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Crafting Experiences
bethany
1
210
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作ろう。
文字を追加してみる