Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ruby Quiz
Search
pocke
October 08, 2017
Programming
650
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby Quiz
at 学生エンジニア限定LT大会
pocke
October 08, 2017
More Decks by pocke
See All by pocke
New "Type" system on PicoRuby
pocke
2
2k
プログラミングで遊ぶ
pocke
0
160
Witchcraft for Memory
pocke
1
6.8k
The path to memory reduction in RBS
pocke
0
100
RBSのメモリ使用量改善への道
pocke
1
91
Community-driven RBS repository
pocke
2
1.7k
Active Record Query Quiz
pocke
1
1.7k
Let's write RBS!
pocke
1
5.5k
RBS and Rails, Present and Future
pocke
1
1.4k
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
520
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
320
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
250
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Are APIs Still Relevant in the AI Era?
soyuka
0
390
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
320
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
370
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.2k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
Java 27新機能 / Java 27 new features
kishida
2
190
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.5k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
ラッコキーワード サービス紹介資料
rakko
1
5.1M
The SEO Collaboration Effect
kristinabergwall1
1
580
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
560
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
560
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
250
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