00001 #include <stdio.h>
00002 #include <global.h>
00003 #include <expand2x.h>
00004
00005
00006
00007 char **map_gen_spiral(int, int, int);
00008 char **roguelike_layout_gen(int xsize, int ysize, int options);
00009 char **make_snake_layout(int xsize, int ysize);
00010 char **make_square_spiral_layout(int xsize, int ysize);
00011 char **gen_corridor_rooms(int, int, int);
00012
00013 void dump_layout(char **layout, int Xsize, int Ysize) {
00014 int i, j;
00015
00016 for (j = 0; j < Ysize; j++) {
00017 for (i = 0; i < Xsize; i++) {
00018 if (layout[i][j] == 0)
00019 layout[i][j] = ' ';
00020 printf("%c", layout[i][j]);
00021 }
00022 printf("\n");
00023 }
00024 }
00025
00026 int main() {
00027 int Xsize, Ysize;
00028 char **layout, **biglayout;
00029 SRANDOM(time(0));
00030
00031 Xsize = RANDOM()%30+10;
00032 Ysize = RANDOM()%20+10;
00033
00034
00035 layout = roguelike_layout_gen(Xsize, Ysize, 0);
00036
00037
00038
00039
00040
00041
00042 dump_layout(layout, Xsize, Ysize);
00043 printf("\nExpanding layout...\n");
00044
00045 biglayout = expand2x(layout, Xsize, Ysize);
00046 dump_layout(biglayout, Xsize*2-1, Ysize*2-1);
00047 return 0;
00048 }