Home > 13th colony, Blog > Faster Random Maps

Faster Random Maps

Fixed the infinite loop! Hah.

Random maps now generate in under 3 seconds.

01-02-03-04-05
 |     |  |
06-07-08-09-10
 |  |     |  |
11-12 13-14-15
 |  |  |  |  |
16-17-18 19-20
 |        |  |
21-22-23-24-25

Array
(
    [0] => 
    [1] => Array
        (
            [x] => 0
            [y] => 0
            [exits] => 6, 2
        )

    [2] => Array
        (
            [x] => 0
            [y] => 1
            [exits] => 1, 3
        )

    [3] => Array
        (
            [x] => 0
            [y] => 2
            [exits] => 8, 2, 4
        )

    [4] => Array
        (
            [x] => 0
            [y] => 3
            [exits] => 9, 3, 5
        )

    [5] => Array
        (
            [x] => 0
            [y] => 4
            [exits] => 4
        )

    [6] => Array
        (
            [x] => 1
            [y] => 0
            [exits] => 1, 11, 7
        )

    [7] => Array
        (
            [x] => 1
            [y] => 1
            [exits] => 12, 6, 8
        )

    [8] => Array
        (
            [x] => 1
            [y] => 2
            [exits] => 3, 7, 9
        )

    [9] => Array
        (
            [x] => 1
            [y] => 3
            [exits] => 4, 14, 8, 10
        )

    [10] => Array
        (
            [x] => 1
            [y] => 4
            [exits] => 15, 9
        )

    [11] => Array
        (
            [x] => 2
            [y] => 0
            [exits] => 6, 16, 12
        )

    [12] => Array
        (
            [x] => 2
            [y] => 1
            [exits] => 7, 17, 11
        )

    [13] => Array
        (
            [x] => 2
            [y] => 2
            [exits] => 18, 14
        )

    [14] => Array
        (
            [x] => 2
            [y] => 3
            [exits] => 9, 19, 13, 15
        )

    [15] => Array
        (
            [x] => 2
            [y] => 4
            [exits] => 10, 20, 14
        )

    [16] => Array
        (
            [x] => 3
            [y] => 0
            [exits] => 11, 21, 17
        )

    [17] => Array
        (
            [x] => 3
            [y] => 1
            [exits] => 12, 16, 18
        )

    [18] => Array
        (
            [x] => 3
            [y] => 2
            [exits] => 13, 17
        )

    [19] => Array
        (
            [x] => 3
            [y] => 3
            [exits] => 14, 24, 20
        )

    [20] => Array
        (
            [x] => 3
            [y] => 4
            [exits] => 15, 25, 19
        )

    [21] => Array
        (
            [x] => 4
            [y] => 0
            [exits] => 16, 22
        )

    [22] => Array
        (
            [x] => 4
            [y] => 1
            [exits] => 21, 23
        )

    [23] => Array
        (
            [x] => 4
            [y] => 2
            [exits] => 22, 24
        )

    [24] => Array
        (
            [x] => 4
            [y] => 3
            [exits] => 19, 23, 25
        )

    [25] => Array
        (
            [x] => 4
            [y] => 4
            [exits] => 20, 24
        )

)
  1. No comments yet.
  1. No trackbacks yet.

css.php