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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
pocke
October 08, 2017
Programming
640
1
Share
Ruby Quiz
at 学生エンジニア限定LT大会
pocke
October 08, 2017
More Decks by pocke
See All by pocke
New "Type" system on PicoRuby
pocke
1
380
プログラミングで遊ぶ
pocke
0
130
Witchcraft for Memory
pocke
1
6.3k
The path to memory reduction in RBS
pocke
0
77
RBSのメモリ使用量改善への道
pocke
1
75
Community-driven RBS repository
pocke
2
1.7k
Active Record Query Quiz
pocke
1
1.7k
Let's write RBS!
pocke
1
5.4k
RBS and Rails, Present and Future
pocke
1
1.4k
Other Decks in Programming
See All in Programming
Moments When Things Go Wrong
aurimas
3
130
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
16
7.5k
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
170
Swiftのレキシカルスコープ管理
kntkymt
0
200
Modding RubyKaigi for Myself
yui_knk
0
810
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
300
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
470
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.1k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
270
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
180
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
190
The untapped power of vector embeddings
frankvandijk
2
1.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
GraphQLとの向き合い方2022年版
quramy
50
15k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Automating Front-end Workflow
addyosmani
1370
210k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
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