Skip to content

Spiral maps.

#25
Auto-translated
Given: "Heroes III".
Task: create a map consisting of 1/8 circle arcs.
Development environment: MS-DOS, Turbo C, Windows 95; Celeron 333.

To do this, you need to draw the circumference boundary and then create a map from it.
The program that calculates the circumference boundary:
/*   Radius   */

#include
#include

main ()
{
int a, b, c, d;
FILE *g;

/* a - radius, for which the calculation is performed
b - maximum value, for which the square root is calculated
c - counter
d - calculated value of the circumference boundary */

g = fopen ("1.txt", "w");
for (a = 1; a < 61; a++) /* outer radius 1/8 of the circle */
{
b = a / sqrt (2) + 2; /* upper limit of calculations */
fprintf (g, "r = %i\n", a);
for (c = 0; c < b; c++)
{
if (c == a) break;
d = sqrt (a * a - c * c - .0001) + 1;
if (d < c) break;
if (d == a) continue;
fprintf (g, "%i - %i\n", c, d);
}

fprintf (g, "\n");
}

fclose (g);
}
As a result, a file is created containing the calculated boundaries of circles of various radii.
But the circle turns out to be uneven. After manual correction, the following is obtained:
r = 1

r = 2

r = 3

r = 4
3 - 3

r = 5
3 - 4

r = 6
4 - 5

r = 7
4 - 6
5 - 5

r = 8
4 - 7
5 - 7
6 - 6

r = 9
5 - 8
6 - 7

r = 10
5 - 9
6 - 9
7 - 8
Download map templates 3 - 12: yadi.sk/d/E7Bi8tVh3Xp2e9
Download the program for calculating radii: yadi.sk/d/0C1Ga-OX3Xp2zG
Download the file with calculated radii: yadi.sk/i/rWN_PXeC3Xp39B
The following map templates were obtained: