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
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
0
120
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
3.3k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
220
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
230
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
33k
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
200
Le côté obscur des IA génératives
pascallemerrer
0
150
CSC509 Lecture 04
javiergs
PRO
0
300
私はどうやって技術力を上げたのか
yusukebe
44
19k
Swift Concurrency - 状態監視の罠
objectiveaudio
2
540
One Enishi After Another
snoozer05
PRO
0
110
Serena MCPのすすめ
wadakatu
4
1k
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
40
2.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
Designing Experiences People Love
moore
142
24k
Six Lessons from altMBA
skipperchong
29
4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
870
RailsConf 2023
tenderlove
30
1.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
Bash Introduction
62gerente
615
210k
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作ろう。
文字を追加してみる