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
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
11k
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
オーケストレーション記述言語 Katari
yukikurage
0
250
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
320
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
Next.js: The final boss of Web Performance
guaca
0
400
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
270
SODA - FACT BOOK(EN)
sodainc
1
230
Featured
See All Featured
The Curse of the Amulet
leimatthew05
4
17k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
660
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Writing Fast Ruby
sferik
630
63k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k