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
680
0
Share
プログラムで迷路を作る
inoha_naito
August 01, 2021
Other Decks in Programming
See All in Programming
今さら聞けないCancellationToken
htkym
0
180
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
1
960
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
470
[BalkanRuby 2026] Drop your app/services!
palkan
3
670
Moments When Things Go Wrong
aurimas
3
110
SkillsをS3 Filesに置く時のあれこれ
watany
4
1.8k
20260514_its_the_context_window_stupid.pdf
heita
0
1.1k
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
210
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
260
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
120
Are We Really Coding 10× Faster with AI?
kohzas
0
230
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
320
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
400
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
750
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
190
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
How STYLIGHT went responsive
nonsquared
100
6.1k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
What's in a price? How to price your products and services
michaelherold
247
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Fireside Chat
paigeccino
42
3.9k
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 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。