Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fizz Buzz問題で(ちょっと) わかる気がするSwift

B1f40d49a9cfed1ed83e53d2456fba2c?s=47 itaru
December 09, 2019

Fizz Buzz問題で(ちょっと) わかる気がするSwift

Fukuoka.LT
福岡のいろんなコミュニティを集められるだけ集めて合同忘年LT大会

B1f40d49a9cfed1ed83e53d2456fba2c?s=128

itaru

December 09, 2019
Tweet

More Decks by itaru

Other Decks in Programming

Transcript

  1. Fukuoka.LT ෱Ԭͷ͍ΖΜͳίϛϡχςΟΛूΊΒΕΔ͚ͩूΊͯ߹ಉ๨೥LTେձ HAKATA.swift ͍ͨΔ Fizz Buzz໰୊Ͱ (ͪΐͬͱ) Θ͔Δؾ͕͢ΔSwift

  2. ࠂ஌

  3. Swift Days Fukuoka 1݄24೔(ۚ)~26೔(೔)

  4. ͳʹͦΕʁ

  5. Swift iOS ίϛϡχςΟ ߹ಉษڧձ

  6. 5ίϛϡχςΟ ࢀՃ

  7. HAKATA Test Night

  8. HAKATA TEST NIGHT

  9. Swift ෮शձ

  10. Swift Ѫ޷ձ

  11. Mr.סഋ΍ʔࣣౡ͞Μ

  12. Θ͍Θ͍swiftc

  13. 1݄24೔(ۚ)~26೔(೔)

  14. 1݄24೔(ۚ)~26೔(೔)

  15. ৔ॴ

  16. ͜͜ LINE Fukuoka

  17. ͝ࢀՃ͍ͩ͘͞

  18. ͞Βʹ

  19. None
  20. try! Swift 2020 Tokyo

  21. try! Swift 2020 Tokyo

  22. ࣗݾ঺հ

  23. ͗͢΋ͱ ͍ͨΔ @itaru_sugimoto ͍ͨΔΜ Money Forward, Inc. υϧϮλ ίϯΧϑΣ

  24. ΍ͬͱຊฤ

  25. Fizz Buzz໰୊Ͱ (ͪΐͬͱ) Θ͔Δؾ͕͢ΔSwift

  26. None
  27. FizzBuzz໰୊?

  28. 3ͰׂΓ੾ΕΔ৔߹͸ʮFizzʯ 5ͰׂΓ੾ΕΔ৔߹͸ʮBuzzʯ ྆ऀͰׂΓ੾ΕΔ৔߹ʢ͢ͳΘͪ15 ͰׂΓ੾ΕΔ৔߹ʣ͸ʮFizz Buzzʯ Λग़ྗ FizzBuzz໰୊ ࢀߟ:https://ja.wikipedia.org/wiki/Fizz_Buzz

  29. ͍ͨΔΜ FizzBuzz໰୊ ΍ͬͯΈͨ

  30. ॳڃฤ

  31. None
  32. let Ͱએݴ͞Εͨม਺ ॻ͖ࠐΊΔͷ͸1౓͚ͩ

  33. CountableClosedRangeܕ ੔਺ͷൣғࢦఆ

  34. Ҿ਺໊ͷলུ // value inলུ

  35. தڃฤ

  36. None
  37. map Ͱ֤ཁૉʹରͯ͠FizzBuzzͷ൑ఆΛߦ͍ ݁ՌΛStringͰฦ͢

  38. reduce ͸ɺ഑ྻͷ݁ՌΛ݁߹Ͱ͖Δ

  39. Computed Properties ฤ

  40. ܾ·ͬͨ஋Λอ͓࣋ͯ͠ΒͣϓϩύςΟ͕ ݺͼग़͞ΕΔ౓ʹܭࢉ͞Εͯ஋ΛऔಘͰ͖Δ

  41. Tuple ฤ

  42. ෳ਺ͷܕ͔ΒҰͭͷܕΛ࡞Δ͜ͱ͕Ͱ͖Δ ҟͳΔܕΛ·ͱΊΒΕΔͷ͕഑ྻͱ͸ҟͳΔ

  43. ऴΘΓ

  44. Summary • Property ΋࢖͍ํ৭ʑʂʂ • map ΍ tuple , enum

    ͳͲศརͳੑ࣭͕͍ͬͺ͍ʂ • ଞʹ΋ compactMap, flatMap ΋ʂʂ • Swiftyͱ͸Կ͔ʁʁʁ • ΋ͬͱ஌Γ͍ͨͱࢥͬͨํ͸ɾɾɾ
  45. Swift Days Fukuoka 1݄24೔(ۚ)~26೔(೔)

  46. ͝ࢀՃ͍ͩ͘͞

  47. Thank you