Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How do i code for neighbour links for a maze creation program

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 def initialize
   super MAP_WIDTH, MAP_HEIGHT, false
   self.caption = "Map Creation"
   @path = nil

   x_cell_count = MAP_WIDTH / CELL_DIM
   y_cell_count = MAP_HEIGHT / CELL_DIM

   @columns =
   column_index = 0

   # first create cells for each position
   while (column_index < x_cell_count)
     row =
     @columns[column_index] = row
     row_index = 0
     while (row_index < y_cell_count)
       cell =
       @columns[column_index][row_index] = cell
       row_index += 1
     column_index += 1

   # now set up the neighbour links
   # You need to do this using a while loop with another
   # nested while loop inside.

God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic