CodingTrain / CodingTrain/Suggestion-Box

topic: random maze genorator

オープン
#970 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
570
フォーク
85
PR マージ指標
30日以内にマージされた PR はありません

説明

I found a way to generate a random maze from a point. I have not found any article about it but i tried programing it and can write some pseudocode.

The main idea:

Draw a point.
Draw another point X far from the first one and draw a line to it.
Pick one of the points and draw another point X far from it and draw a line to that point.
and so on but you only have to follow one rule:

**never let two points go closer than X far from each other**

it is not as easy as it sounds because of lag but i think a quadtree would work.

[https://codepen.io/ProGramer31415/pen/BxPWXx](url)

Here is some pseudocode, I am not good at writing pseudocode:
```
class node {
main(x, y) {
keep position of node
create an array of nodes created from this node, starts empty
}
addChild(x, y) {
create new child at x, y
add child to array of children
}
draw() {
draw line from node to all children
}
}

class maze {
main(segment-length) {
create array / quadtree of nodes and add one node to it
create variable with length of each segment
}

update() {
pick a random node
pick a random position segment-length far from the node
check if the random position is legal with moveLegal
if its legal {
add a new kid to the random node with the random position
add the kid to the array of nodes
}
}

moveLegal(x, y) {
check if the length to the closest node in the mazes array of nodes is more than segment-length.
if so return true
else return false
}
}
```

screenshot 2018-05-14 16 23 53

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、リンクされたCodePenと擬似コードを確認してください。これらが提供されている唯一の実装リファレンスです。Issueにはリポジトリのファイル、エントリポイント、テスト、受け入れ基準が記載されていないため、作業を開始する前に、想定される実装範囲とdefinition of doneを確定する必要があります。

索引モデルが issue の本文から書いたものです。

評価

領域
game-dev
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。