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
Fizz Buzz問題で(ちょっと) わかる気がするSwift
Search
itaru
December 09, 2019
Programming
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Fizz Buzz問題で(ちょっと) わかる気がするSwift
Fukuoka.LT
福岡のいろんなコミュニティを集められるだけ集めて合同忘年LT大会
itaru
December 09, 2019
Transcript
47 slides
Fukuoka.LT Ԭͷ͍ΖΜͳίϛϡχςΟΛूΊΒΕΔ͚ͩूΊͯ߹ಉLTେձ HAKATA.swift ͍ͨΔ Fizz BuzzͰ (ͪΐͬͱ) Θ͔Δؾ͕͢ΔSwift
ࠂ
Swift Days Fukuoka 1݄24(ۚ)~26()
ͳʹͦΕʁ
Swift iOS ίϛϡχςΟ ߹ಉษڧձ
5ίϛϡχςΟ ࢀՃ
HAKATA Test Night
HAKATA TEST NIGHT
Swift ෮शձ
Swift Ѫձ
Mr.סഋʔࣣౡ͞Μ
Θ͍Θ͍swiftc
1݄24(ۚ)~26()
1݄24(ۚ)~26()
ॴ
͜͜ LINE Fukuoka
͝ࢀՃ͍ͩ͘͞
͞Βʹ
None
try! Swift 2020 Tokyo
try! Swift 2020 Tokyo
ࣗݾհ
͗͢ͱ ͍ͨΔ @itaru_sugimoto ͍ͨΔΜ Money Forward, Inc. υϧϮλ ίϯΧϑΣ
ͬͱຊฤ
Fizz BuzzͰ (ͪΐͬͱ) Θ͔Δؾ͕͢ΔSwift
None
FizzBuzz?
3ͰׂΓΕΔ߹ʮFizzʯ 5ͰׂΓΕΔ߹ʮBuzzʯ ྆ऀͰׂΓΕΔ߹ʢ͢ͳΘͪ15 ͰׂΓΕΔ߹ʣʮFizz Buzzʯ Λग़ྗ FizzBuzz ࢀߟ:https://ja.wikipedia.org/wiki/Fizz_Buzz
͍ͨΔΜ FizzBuzz ͬͯΈͨ
ॳڃฤ
None
let Ͱએݴ͞Εͨม ॻ͖ࠐΊΔͷ1͚ͩ
CountableClosedRangeܕ ͷൣғࢦఆ
Ҿ໊ͷলུ // value inলུ
தڃฤ
None
map Ͱ֤ཁૉʹରͯ͠FizzBuzzͷఆΛߦ͍ ݁ՌΛStringͰฦ͢
reduce ɺྻͷ݁ՌΛ݁߹Ͱ͖Δ
Computed Properties ฤ
ܾ·ͬͨΛอ͓࣋ͯ͠ΒͣϓϩύςΟ͕ ݺͼग़͞ΕΔʹܭࢉ͞ΕͯΛऔಘͰ͖Δ
Tuple ฤ
ෳͷܕ͔ΒҰͭͷܕΛ࡞Δ͜ͱ͕Ͱ͖Δ ҟͳΔܕΛ·ͱΊΒΕΔͷ͕ྻͱҟͳΔ
ऴΘΓ
Summary • Property ͍ํ৭ʑʂʂ • map tuple , enum
ͳͲศརͳੑ࣭͕͍ͬͺ͍ʂ • ଞʹ compactMap, flatMap ʂʂ • SwiftyͱԿ͔ʁʁʁ • ͬͱΓ͍ͨͱࢥͬͨํɾɾɾ
Swift Days Fukuoka 1݄24(ۚ)~26()
͝ࢀՃ͍ͩ͘͞
Thank you
More Decks by itaru
See All by itaru
Swiftでswizzling
itaru0724
0
500
Other Decks in Programming
See All in Programming
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.7k
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
230
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
4k
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
240
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
220
Event is what happens
moro
2
4.5k
AI-Powered Domain-Driven Design
ziobrando
0
430
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
350
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
310
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
610
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
560
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310
Test your architecture with Archunit
thirion
2
2.5k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
620
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
530