38 lines
906 B
C
38 lines
906 B
C
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
#include "prettynames.h"
|
|
#include "random.h"
|
|
#include "world.h"
|
|
|
|
int main() {
|
|
uint32_t seed;
|
|
printf("Enter seed: ");
|
|
scanf("%u", &seed);
|
|
set_random_seed(seed);
|
|
|
|
world_t world;
|
|
world_generate(&world);
|
|
|
|
uint16_t x = WORLD_WIDTH / 2;
|
|
uint16_t y = WORLD_HEIGHT / 2;
|
|
const quadrant_t *centre = world_get_quadrant(&world, x, y);
|
|
if (centre == NULL) {
|
|
printf("Failed to read centre quadrant.\n");
|
|
return 1;
|
|
}
|
|
|
|
printf("Generated world: %ux%u\n", WORLD_WIDTH, WORLD_HEIGHT);
|
|
printf(
|
|
"Centre (%u, %u): type=%s (%d), old=%s, visited=%s, discovered=%s\n",
|
|
x, y,
|
|
quadrant_type_name(centre->type),
|
|
(int)centre->type,
|
|
centre->is_old ? "true" : "false",
|
|
centre->is_visited ? "true" : "false",
|
|
centre->is_discovered ? "true" : "false"
|
|
);
|
|
|
|
return 0;
|
|
}
|