$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
プログラムで迷路を作る
Search
inoha_naito
August 01, 2021
Programming
0
620
プログラムで迷路を作る
inoha_naito
August 01, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
tparseでgo testの出力を見やすくする
utgwkk
1
190
connect-python: convenient protobuf RPC for Python
anuraaga
0
400
Developing static sites with Ruby
okuramasafumi
0
260
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
380
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
220
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.1k
JETLS.jl ─ A New Language Server for Julia
abap34
1
340
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
2.6k
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
420
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
440
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Side Projects
sachag
455
43k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Building Adaptive Systems
keathley
44
2.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Done Done
chrislema
186
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Rails Girls Zürich Keynote
gr2m
95
14k
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 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。