Don't use ALL CAPS for headings. Reformat them in the style
recommended by doc/coding. Drop a few comments that aren't pulling
their weight, and fix the odd typo.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
#define DEFAULT_OUTFILE_NAME "newcap_script"
static const char *outfile = DEFAULT_OUTFILE_NAME;
#define DEFAULT_OUTFILE_NAME "newcap_script"
static const char *outfile = DEFAULT_OUTFILE_NAME;
-#define STABLE_CYCLE 4 /* stability required for perterbed capitals */
+#define STABLE_CYCLE 4 /* stability required for perturbed capitals */
#define DRIFT_BEFORE_CHECK ((WORLD_X + WORLD_Y)/2)
#define DRIFT_MAX ((WORLD_X + WORLD_Y)*2)
#define DRIFT_BEFORE_CHECK ((WORLD_X + WORLD_Y)/2)
#define DRIFT_MAX ((WORLD_X + WORLD_Y)*2)
#define new_x(newx) (((newx) + WORLD_X) % WORLD_X)
#define new_y(newy) (((newy) + WORLD_Y) % WORLD_Y)
#define new_x(newx) (((newx) + WORLD_X) % WORLD_X)
#define new_y(newy) (((newy) + WORLD_Y) % WORLD_Y)
void print_distance_map(void);
void print_elev_map(void);
void print_distance_map(void);
void print_elev_map(void);
-/****************************************************************************
- MAIN
-****************************************************************************/
int
main(int argc, char *argv[])
int
main(int argc, char *argv[])
-/****************************************************************************
- VARIABLE INITIALIZATION
-****************************************************************************/
+
+/*
+ * Variable initialization
+ */
static void
allocate_memory(void)
static void
allocate_memory(void)
memset(adj_land, 0, WORLD_SZ() * sizeof(*adj_land));
}
memset(adj_land, 0, WORLD_SZ() * sizeof(*adj_land));
}
-/****************************************************************************
- DRIFT THE CAPITALS UNTIL THEY ARE AS FAR AWAY FROM EACH OTHER AS POSSIBLE
-****************************************************************************/
+
+/*
+ * Drift the capitals until they are as far away from each other as possible
+ */
/*
* How isolated is capital @j at @newx,@newy?
/*
* How isolated is capital @j at @newx,@newy?
* Drift capital @j.
* Move it to an adjacent sector where it is at least as isolated.
*/
* Drift capital @j.
* Move it to an adjacent sector where it is at least as isolated.
*/
static void
drift_capital(int j)
{
static void
drift_capital(int j)
{
-/****************************************************************************
- GROW THE CONTINENTS
-****************************************************************************/
static int
is_coastal(int x, int y)
static int
is_coastal(int x, int y)
-/****************************************************************************
- GROW THE ISLANDS
-****************************************************************************/
-
/*
* Place additional island @c's first sector.
* Return 1 on success, 0 on error.
/*
* Place additional island @c's first sector.
* Return 1 on success, 0 on error.
-/****************************************************************************
- CREATE ELEVATIONS
-****************************************************************************/
+
+/*
+ * Create elevations
+ */
+
static void
create_elevations(void)
{
static void
create_elevations(void)
{
-/****************************************************************************
- ADD THE RESOURCES
-****************************************************************************/
+
+/*
+ * Add resources
+ */
/*
* Map elevation @elev to a resource value according to @conf.
/*
* Map elevation @elev to a resource value according to @conf.
sct->sct_uran = elev_to_resource(sct->sct_elev, uran_conf);
}
sct->sct_uran = elev_to_resource(sct->sct_elev, uran_conf);
}
-/****************************************************************************
- DESIGNATE THE SECTORS
-****************************************************************************/
+
+/*
+ * Designate the sectors
+ */
static void
write_sects(void)
static void
write_sects(void)
-/****************************************************************************
- PRINT A PICTURE OF THE MAP TO YOUR SCREEN
-****************************************************************************/
+
+/*
+ * Print a picture of the map
+ */
+
static void
output(void)
{
static void
output(void)
{
-/***************************************************************************
- WRITE A SCRIPT FOR PLACING CAPITALS
-****************************************************************************/
+/*
+ * Write a script for placing capitals
+ */
+
static int
write_newcap_script(void)
{
static int
write_newcap_script(void)
{