Spike

Spike

  • NA
  • 1
  • 0

Recursive algorithm - datatype

Mar 5 2010 11:24 AM
Hi,

I am stuck with the following recursive problem:

Create a rectangular space with a given height (n) and width (m) that's divided into random rectangular rooms.
Rooms are divided by walls, a wall has a width of 1, the space between two walls is d>=1.

For example:
+++++++++++++++++++++++++++++++++
+..+....+.............+.........+
+..+....+.............+.........+
+..+....+.............+.........+
+..+....+++++++++++++++++++++++++
+..+....+...+.....+........+....+
+++++++++...+.....+........+....+
+....+..+++++++++++++++++++++++++
+....+..+......+..+......+......+
+....+..+......+..+......+......+
+++++++++++++++++++++++++++++++++

I have already tried a two dimensional array but I got stuck, so I thought of using a double arraylist but I am not quite sure, could anyone give me a helping hand?

Thanks a lot!

Answers (1)