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 Quiz
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
pocke
October 08, 2017
Programming
1
610
Ruby Quiz
at 学生エンジニア限定LT大会
pocke
October 08, 2017
Tweet
Share
More Decks by pocke
See All by pocke
プログラミングで遊ぶ
pocke
0
95
Witchcraft for Memory
pocke
1
4.4k
The path to memory reduction in RBS
pocke
0
50
RBSのメモリ使用量改善への道
pocke
1
62
Community-driven RBS repository
pocke
2
1.5k
Active Record Query Quiz
pocke
1
1.6k
Let's write RBS!
pocke
1
5.2k
RBS and Rails, Present and Future
pocke
1
1.4k
The newsletter of RBS updates
pocke
1
3.5k
Other Decks in Programming
See All in Programming
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
360
Implementation Patterns
denyspoltorak
0
270
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
350
SourceGeneratorのススメ
htkym
0
160
CSC307 Lecture 06
javiergs
PRO
0
670
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
2026年 エンジニアリング自己学習法
yumechi
0
120
AtCoder Conference 2025
shindannin
0
1k
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
400
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
130
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
180
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
190
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
230
[SF Ruby Conf 2025] Rails X
palkan
0
730
The Spectacular Lies of Maps
axbom
PRO
1
480
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
48
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
85
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
The Curse of the Amulet
leimatthew05
1
7.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.6k
Transcript
Ruby Quiz Oct. 8, 2017 第4回 学生エンジニア限定LT大会
I have only 5 minutes, so I'll speak very fast.
Self introduction • Pocke • Actcat, Inc. / SideCI •
RuboCop' s core developer • Student at The Open University of Japan
SideCI
Automated Code Review as a Service
Please access here! https://sideci.com
Ruby Quiz
Question
Do you write Ruby?
Ruby Quiz • You are a Ruby interpreter. ◦ You
are a parse.y. ◦ You are a YARV. • You execute ruby code, and you output result.
Quiz 1
Q. What does the code output? p(??) p(%_?_)
Answer p(??) # => "?" p(%_?_) # => "?"
Why?
A. Why does it output "?"? p(??) p(%_?_) %<any character>…<any
character> is a string literal. e.g.) %_?_ == "?" , %!???! == "???" ?_ is a character literal. e.g.) ?_ == "_" , ?? == "?"
Quiz 2
Q. What does the code output? p(????::?:) p(% %s% %%%%)
Answer p(????::?:) # => ":" p(% %s% %%%%) # =>
"%"
Why????
Answer p(????::?:) p(% %s% %%%%) 1. ?? is "?" 2.
? is a part of conditional op 3. ?: is ":" 4. : is a part of conditional op 5. ?: is ":" "?" ? ":" : ":" 1. % %s% is "%s%" 2. % is a format op(Like sprintf) 3. %%% is "" sprintf("%s%", "")
Quiz 3
Q. What does the code output? a = ["1","2","3"] a&.map(&:to_i)&.&([1])
Answer a = ["1","2","3"] a&.map(&:to_i)&.&([1]) # => [1]
Why?????
Answer a = ["1","2","3"] a&.map(&:to_i)&.&([1]) # => [1] &. is
a safe navigation op(nil guard). &:to_i is an implicit to_proc op. A safe navigation op & is an intersection op call (like [1,2,3] & [1])
Conclusion
• We can write tricky code in Ruby. ◦ Very
fun!!! Thank you for listening! Conclusion