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
860
プログラミングで遊ぶ
pocke
0
140
Witchcraft for Memory
pocke
1
6.4k
The path to memory reduction in RBS
pocke
0
83
RBSのメモリ使用量改善への道
pocke
1
79
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
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
170
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
740
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
120
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.6k
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
230
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
170
Claspは野良GASの夢をみるか
takter00
0
190
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.7k
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
430
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
280
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
120
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
330
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
The Cult of Friendly URLs
andyhume
79
6.9k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
720
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
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