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
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
1
1.3k
プログラミングで遊ぶ
pocke
0
150
Witchcraft for Memory
pocke
1
6.6k
The path to memory reduction in RBS
pocke
0
94
RBSのメモリ使用量改善への道
pocke
1
86
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
FDEが実現するAI駆動経営の現在地
gonta
2
260
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
540
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
1
120
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
570
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
200
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
Claude Team Plan導入・ガイド
tk3fftk
0
250
今さら聞けない .NET CLI
htkym
0
180
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
120
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
620
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.2k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
320
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
Discover your Explorer Soul
emna__ayadi
2
1.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
Why Our Code Smells
bkeepers
PRO
340
58k
Bash Introduction
62gerente
615
220k
Everyday Curiosity
cassininazir
0
270
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
410
Measuring & Analyzing Core Web Vitals
bluesmoon
9
950
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