Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
プログラムで迷路を作る
Search
inoha_naito
August 01, 2021
Programming
750
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
プログラムで迷路を作る
inoha_naito
August 01, 2021
Transcript
12 slides
プログラムで迷路を作る
自己紹介 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 他にも、 迷路生成だと「穴掘り法」や「壁伸ばし法」 迷路探索だと「幅優先探索」や「深さ優先探索」 また、ダンジョン生成アルゴリズムなどもある。
Other Decks in Programming
See All in Programming
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
170
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
120
joyful-journey-spring-boot.pdf
hollycummins
0
130
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
1.3k
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
220
Promiseの向こう側へコンテキストを届ける ― proposal-async-context
seriseri
0
850
はじめてのKubernetesコントリビューション
nasa9084
0
330
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
1
1.1k
祈るテストから、探索するテストへ 〜Lincheckではじめる並行処理テスト〜
yyh_gl
0
440
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
360
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
440
Well, that’s weird…
csswizardry
3
260
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
Facilitating Awesome Meetings
lara
57
7.2k
Code Reviewing Like a Champion
maltzj
529
40k
GraphQLとの向き合い方2022年版
quramy
50
15k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Embracing the Ebb and Flow
colly
88
5.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k