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
GameplayKit, GKRandomSource, GKRandomDistribution
Search
kichikuchi
October 23, 2015
Programming
300
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GameplayKit, GKRandomSource, GKRandomDistribution
shibuya.swift #1 発表資料
kichikuchi
October 23, 2015
More Decks by kichikuchi
See All by kichikuchi
swiftにおける遅延評価
kichikuchi
0
3k
tableViewとcoolectionviewのパフォーマンスチューニング
kichikuchi
1
640
AB Tests in Mobile App
kichikuchi
1
2k
Other Decks in Programming
See All in Programming
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
180
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
660
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
350
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.5k
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
120
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
200
WebAssembly in Android Apps 〜 WASMはJNIの夢を見るか
keiji
1
110
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.1k
Family mrubyの進捗
kishima
1
130
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
180
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
2.9k
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
520
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
Why Our Code Smells
bkeepers
PRO
340
58k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Marketing to machines
jonoalderson
1
5.8k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
Navigating Team Friction
lara
192
16k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Amusing Abliteration
ianozsvald
1
310
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
500
Side Projects
sachag
456
43k
Transcript
(BNFQMBZ,JUͷհ !LJDIJLVDIJ TIJCVZBTXJGU
ࣗݾհ w ٠ل ,B[VOPSJ,JLVDIJ w !LJDIJLVDIJ w J04ΤϯδχΞ w
(.0ϖύϘɿNJOOFνʔϜ w 0CKFDUJWF$ྺɿͱ
(BNFQMBZ,JUͷલʹ w 4QSJUF,JU w J04Ҏ্ʹରԠ͢ΔήʔϜ։ൃ༻ϑϨʔϜϫʔΫ w εϓϥΠτʹΞχϝʔγϣϯΛઃఆ w ཧγϛϡϨʔγϣϯʹΑΔিಥͷ࠶ݱ w
ήʔϜͷΞχϝʔγϣϯ෦Λ୲
(BNFQMBZ,JUͱ w J04͔ΒՃ͞ΕͨήʔϜͷγεςϜ෦ͷجຊ ػೳΛఏڙͯ͘͠ΕΔϑϨʔϜϫʔΫ w ήʔϜͷγεςϜ෦Λ୲
(BNFQMBZ,JUͷΫϥε w ͍͔ͭ͘ϐοΫΞοϓ ৄ͘͠SFGΛࢀর w (,3BOEPN4PVSDF w (,3BOEPN%JTUSJCVUJPO w (,.JONBY4USBUFHJTU
w (,(SBQI w (,"HFOU w (,3VMF4ZTUFN
(BNFQMBZ,JUͷΫϥε w ͍͔ͭ͘ϐοΫΞοϓ ৄ͘͠SFGΛࢀর w (,3BOEPN4PVSDF w (,3BOEPN%JTUSJCVUJPO w (,.JONBY4USBUFHJTU
w (,(SBQI w (,"HFOU w (,3VMF4ZTUFN
(,3BOEPN4PVSDF w ཚΛੜ͢Δ let rundomNumber = GKRandomSource.sharedRandom().nextInt() let rundomNumber2
= GKRandomSource.sharedRandom().nextIntWithUpperBound(6) < d > <d> w ཚੜͷΞϧΰϦζϜ w "3$
༷ʑͳੜํ๏ w (,"3$3BOEPN4PVSDF w ໌ࣔతʹTFFEΛ༩͑ͯཚΛੜ͢Δ let rundomNumber = GKARC4RandomSource.init(seed:
data).nextInt() w ผΞϧΰϦζϜͰཚΛੜ w (,-JOFBS$POHSVFOUJBM3BOEPN4PVSDF w )JHI1FSGPSNBODF -PX3BOEPNOFTT w (,.FSTFOOF5XJTUFS3BOEPN4PVSDF w )JHI3BOEPNOFTT -PX1FSGPSNBODF
ྻͷγϟοϑϧ let numbers = [Int](1...100) let shuffledNumbers = GKRandomSource.sharedRandom().arrayByShufflingObjectsInArray(number
s)
(,3BOEPN%JTUSJCVUJPO w ಛఆͷ֬ʹجͮ͘ཚΛੜͰ͖Δ w (,(BVTTJBO%JTUSJCVUJPO w (,4IV⒐FE%JTUSJCVUJPO let diceNumber
= GKRandomDistribution.d6().nextInt() let asakusaLine = GKRandomDistribution.d20().nextInt() let original = GKRandomDistribution(randomSource: GKMersenneTwisterRandomSource(), lowestValue: 10, highestValue: 20).nextInt() <d> <d> <d>
(,(BVTTJBO%JTUSJCVUJPO w ਖ਼نʹجͮ͘ཚΛੜ for (var i = 0; i
< 10000; i++) { print(GKGaussianDistribution.d20().nextInt()) }
(,4IV⒐FE%JTUSJCVUJPO w ࢦఆ͞ΕͨൣғͷࣈΛ̍ճͮͭબ͢Δ for (var i = 0; i
< 10000; i++) { print(GKShuffledDistribution.d20().nextInt()) }
ཚͷҰ୴ऴΘΓʂ
͕͜͜Πέͯͳ͍Αʂ w 0CKFDUJWF$ͷΈͰར༻Մೳͳϝιου͕ଟ
͕͜͜Πέͯͳ͍Αʂʂ w 0CKFDUJWF$ w ϝιουɿݸ w 4XJGU w ϝιουɿݸ
·ͱΊ w (BNFQMBZ,JU֓ཁ w ήʔϜγεςϜ෦ͷ࡞ʹศརͳػೳΛଟఏ ڙͯ͘͠ΕΔ w (,3BOEPN΄ʹΌΒΒ w ༷ʑͳཚΛखܰʹੜ
w ήʔϜҎ֎Ͱར༻Մೳʂ w 0CKFDUJWF$ͷΈར༻Մೳͳϝιου͕ଟ