Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!

Rand Dom

Greenhorn
+ Follow
since May 30, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rand Dom

def button_down(id)
   case id
   when Gosu::MsLeft
     @locs = [mouse_x, mouse_y]
 if mouse_over_button?(mouse_x, mouse_y)
       @background = Gosu::Color::YELLOW
@locs = rand(mouse_x..mouse_y)
 else
@background = Gosu::Color::WHITE
 end
   end
 end
end
2 months ago
 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 = Array.new(x_cell_count)
   column_index = 0

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

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

 end
2 months ago