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
One Line If
Search
Vinicius Gomes
July 01, 2014
Programming
380
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
One Line If
Based on this blog post:
http://vvgomes.com/one-line-if/
Vinicius Gomes
July 01, 2014
More Decks by Vinicius Gomes
See All by Vinicius Gomes
Golpes e Fraudes Bancárias
vvgomes
0
57
Monitoramento de SEO com Cloud Functions
vvgomes
0
54
Thinking Event Driven Architectures with Serverless
vvgomes
0
2k
Quando Microserviçoes Encontram Event Sourcing
vvgomes
0
300
Arquitetura Orientada a Eventos no mundo Serverless
vvgomes
0
450
When Microservices Meet Event Sourcing
vvgomes
6
1.3k
When Microservices met Event Sourcing
vvgomes
1
610
Feature Leads
vvgomes
1
870
As Melhores Práticas na Condução de Entrevistas Técnicas
vvgomes
0
700
Other Decks in Programming
See All in Programming
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
130
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
480
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
250
Dockerfile CMD for Node.js
grazie1999
0
160
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
670
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
270
Press start. Python's next generation.
willingc
PRO
3
290
初めての模倣学習とVLA
natsutan
0
370
自分的「カンファレンスの楽しみ方」
syumai
0
150
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
250
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
180
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.3k
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
490
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
460
Designing Experiences People Love
moore
143
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
490
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Darren the Foodie - Storyboard
khoart
PRO
3
3.8k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
230
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
830
The SEO identity crisis: Don't let AI make you average
varn
0
550
Transcript
one line if
Why? • Improve reading effectiveness • Improve maintenance
Motivation • Cyclomatic complexity • Mental stack limitations
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
None
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } }; hit
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } }; mistake
this.guess = function(letter) { if(hiddenWord.reveal(letter)) hit(); else mistake(); }; var
hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } }; win
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } }; lose
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) win(); }; var mistake = function() { image.showNext(); if(--chances == 0) lose(); }; var win = function() { alert('You Kick Asses!'); nextLevel(); }; var lose = function() { alert('Looooser!'); gameOver(); };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); win.when(hiddenWord.isEverythingRevealed()); }; var mistake = function() { image.showNext(); lose.when(--chances == 0) }; var win = function() { alert('You Kick Asses!'); nextLevel(); }; var lose = function() { alert('Looooser!'); gameOver(); };
None