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
プログラムで迷路を作る
Search
inoha_naito
August 01, 2021
Programming
0
560
プログラムで迷路を作る
inoha_naito
August 01, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
790
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
240
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
290
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
540
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
110
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
270
10 Costly Database Performance Mistakes (And How To Fix Them)
andyatkinson
0
240
Discover Metal 4
rei315
2
130
Is Xcode slowly dying out in 2025?
uetyo
1
260
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
260
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
1
430
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
4
6.5k
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
42
7.6k
Rails Girls Zürich Keynote
gr2m
94
14k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Building Adaptive Systems
keathley
43
2.7k
Documentation Writing (for coders)
carmenintech
72
4.9k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Unsuck your backbone
ammeep
671
58k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Site-Speed That Sticks
csswizardry
10
680
Transcript
プログラムで迷路を作る
自己紹介 HN: いのは Twitter: @inoha_naito Webサイト: miraiportal(技術系ブログ) https://miraiportal.com/ 最近は、 ジョジョの7部経由で
SOUL‘d OUTの『ウェカピポ』にハマり 1日4,5回くらい聴いています。
今回の内容 迷路生成アルゴリズムのひとつ 「棒倒し法」を JavaScriptのライブラリ 「p5.js」を用いて実装しています。 日本語少なめ、 画像マシマシです。
準備
1. 格子を描画する
2. 配列に対応するセルを塗る
本編
3. 配列に外壁をセットする
4. 配列に内壁をセットする
5. 配列に壁をランダムにセットする
シード値を設定する(おまけ)
まとめ 今回のプログラム https://editor.p5js.org/inoha_naito/sketches/QGkMf2Mhv 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。