Skip to main content
GameDev.net gamedev.net
🔒 Locked

Filling a grid using Hamiltonian paths

Started by Murloc992 Oct 22, 2015 at 10:16 AM 0 replies 1.5k views
Original Post
Murloc992
Murloc992
Hello,
recently I was trying to implement a Hamilton path function to generate/fill a grid of points with a snake-like path.
Generally the code I have now miss-performs in the beginning and near the last steps, between those (80% of the generation) everything seems extremely fine. I really cannot find what would be the issue. Seems like my nodes just snap and another, related node gets placed in a completely random spot. Maybe somebody could point out where I did a mistake?
Here is my Pastebin code:
I am using GLM for vec2 class, but a simple struct with int x and y would do.
Thanks in advance!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.