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
670
0
Share
プログラムで迷路を作る
inoha_naito
August 01, 2021
Other Decks in Programming
See All in Programming
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
Swift Concurrency Type System
inamiy
0
540
Coding as Prompting Since 2025
ragingwind
0
840
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
150
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
980
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
🦞OpenClaw works with AWS
licux
1
160
実践CRDT
tamadeveloper
0
580
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
160
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
340
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.4k
The Less-Told Story of Socket Timeouts
coe401_
3
450
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Curious Case for Waylosing
cassininazir
0
310
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
310
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
420
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
490
So, you think you're a good person
axbom
PRO
2
2k
Exploring anti-patterns in Rails
aemeredith
3
320
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
Writing Fast Ruby
sferik
630
63k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
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 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。