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
「人を評価する AI」の設計と実装
ryoyanara
0
200
VibeCodingからAgenticWorkflowへ
starfish719
0
490
Flow は今どうなっているか
mizdra
PRO
0
560
Android CLI
fornewid
0
220
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
130
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
250
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
170
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
180
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
520
Go 1.27 における memory allocation の高速化
andpad
0
180
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
380
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
630
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
760
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
240
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
280
Balancing Empowerment & Direction
lara
6
1.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
470
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1.1k
Writing Fast Ruby
sferik
630
63k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Odyssey Design
rkendrick25
PRO
2
760
Designing for humans not robots
tammielis
254
26k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
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作ろう。
文字を追加してみる