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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
inoha_naito
August 01, 2021
Programming
710
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
プログラムで迷路を作る
inoha_naito
August 01, 2021
Other Decks in Programming
See All in Programming
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
280
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
16k
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
0
190
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
240
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
920
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
2.4k
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
560
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
180
yield再入門 #phpcon
o0h
PRO
0
760
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
550
What's New in Android 2026
veronikapj
0
210
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
The agentic SEO stack - context over prompts
schlessera
0
850
Side Projects
sachag
455
43k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
510
Ruling the World: When Life Gets Gamed
codingconduct
0
290
Exploring anti-patterns in Rails
aemeredith
3
450
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.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 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。