lorem-ipsumm / Maze-Solving-and-Generating

This is a program I've created that generates and solves mazes using DFS and Randomized Prim's Algorithm
2 stars 0 forks source link

Error at runtime #1

Closed erralb closed 6 years ago

erralb commented 6 years ago

Hi, trying to run your program and I get this error :

/web/maze|master ⇒  node index.js 
Rows & Colums(odd number pls): 5
Maze Generated: 3.309ms

/web/maze/generate.js:202
    solver("./output/new_maze.png");
    ^

TypeError: solver is not a function
    at create (/web/maze/generate.js:202:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)
    at create (/web/maze/generate.js:196:5)

I'm not familiar at all with node. I also tried :

/web/maze|master ⇒  npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN maze@1.0.0 No repository field.

removed 1 package in 0.42s

Seems like I'm doing something wrong here, could you help me please? I'm using Node v8.9.1 on Debian 9

erralb commented 6 years ago

damn... just had to run :

node generate.js

lorem-ipsumm commented 6 years ago

Haha. Sorry I couldn't help. I was asleep. Thanks for bringing this up though. I'll try and make the instructions more clear on how to run it

On Mon, Dec 4, 2017 at 11:52 AM, Piero notifications@github.com wrote:

damn... just had to run :

node generate.js

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SolarFloss/Maze-Solving-and-Generating/issues/1#issuecomment-349024831, or mute the thread https://github.com/notifications/unsubscribe-auth/AGJCXy1bxEHPNbKLhT77mjYPI9LbLjBRks5s9CNDgaJpZM4Q04-s .

erralb commented 6 years ago

No worries thanks for the reply.

We have to code different AI algorithms for a university project, so we are going to use your program as a base for new implementations. I will make a pull request when it's done if you're interested! :)

lorem-ipsumm commented 6 years ago

Oh okay that sounds great. Yeah feel free to make the pull request when you're done. How'd you come across my code by the way?

On Mon, Dec 4, 2017 at 12:33 PM, Piero notifications@github.com wrote:

No worries thanks for the reply.

We have to code different AI algorithms for a university project, so we are going to use your program as a base for new implementations. I will make a pull request when it's done if you're interested! :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SolarFloss/Maze-Solving-and-Generating/issues/1#issuecomment-349039283, or mute the thread https://github.com/notifications/unsubscribe-auth/AGJCX-FE7vMwOuR2JKYTObabVRLhO2Irks5s9CzsgaJpZM4Q04-s .

erralb commented 6 years ago

Googling :) We actually decided on a maze solving game for our project, but we only have to code the AI algorithms... So I was looking for a base to start on, and searched for something with similar words to your project name :)

lorem-ipsumm commented 6 years ago

Ah yes of course. Well good luck, and let me know if you run into any issues regarding my code

On Dec 4, 2017 12:35 PM, "Piero" notifications@github.com wrote:

Googling :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SolarFloss/Maze-Solving-and-Generating/issues/1#issuecomment-349039901, or mute the thread https://github.com/notifications/unsubscribe-auth/AGJCXy2YCJHjl0tNdho_XjLW1J1M3tP7ks5s9C1cgaJpZM4Q04-s .

erralb commented 6 years ago

Thanks will do! :) We dont'have much time for the project, but ideally we'd like to implement a user interaction interface so a player can also play against the AIs.

BTW can you give me some light as why even numbers aren't working for the maze generation?

lorem-ipsumm commented 6 years ago

I ran into this issue about a month ago and I cannot remember what I did to fix it. There were numbers that just wouldn't work or something. I'll look into it and get back to you

On Mon, Dec 4, 2017 at 12:39 PM, Piero notifications@github.com wrote:

Thanks will do! :) We dont'have much time for the project, but ideally we'd like to implement a user interaction interface so a player can also play against the AIs.

BTW can you give me some light as why even numbers aren't working for the maze generation?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SolarFloss/Maze-Solving-and-Generating/issues/1#issuecomment-349041231, or mute the thread https://github.com/notifications/unsubscribe-auth/AGJCXzSbvC3C3jqXTTNeK0xX9tWmD1Xfks5s9C5KgaJpZM4Q04-s .

lorem-ipsumm commented 6 years ago

Oh, I misread your question. I thought numbers just were not working. When you enter an odd number it will in fact generate a maze, but there will be all black tiles on the bottom of the map. I made it so it would place the finish tile in a random white tile on the bottom row, but if they are all black, it never places the finish tile. That's at least what I think is going on.

Here is 52 Rows: new_maze

It's small but you can see that on the bottom there are no available white tiles.

Here is 51 Rows: new_maze

There are plenty of white tiles to pick from. This is probably solved in an easy way, I just haven't looked at this project in a while. Hope that helped

erralb commented 6 years ago

Cool thanks for the explanation, makes sense :)