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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
inoha_naito
August 01, 2021
Programming
0
640
プログラムで迷路を作る
inoha_naito
August 01, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
Apache Iceberg V3 and migration to V3
tomtanaka
0
170
Fluid Templating in TYPO3 14
s2b
0
130
Patterns of Patterns
denyspoltorak
0
1.4k
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
230
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
750
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
AgentCoreとHuman in the Loop
har1101
5
240
Grafana:建立系統全知視角的捷徑
blueswen
0
330
今から始めるClaude Code超入門
448jp
8
9k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
ぼくの開発環境2026
yuzneri
0
240
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
57
Ethics towards AI in product and experience design
skipperchong
2
200
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
98
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
Being A Developer After 40
akosma
91
590k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Are puppies a ranking factor?
jonoalderson
1
2.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
4 Signs Your Business is Dying
shpigford
187
22k
Raft: Consensus for Rubyists
vanstee
141
7.3k
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 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。