Increase type diversity (increased chance of obtuse triangles)
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"characterRegex": "[type:θ=EquilarIsocSn¯¹0123456789]",
|
"characterRegex": "[ntype:θ=acuobsrigh¯¹0123456789]",
|
||||||
"file": "mansalva_regular.ttf",
|
"file": "mansalva_regular.ttf",
|
||||||
"name": "FONT_MANSALVA_REGULAR_22",
|
"name": "FONT_MANSALVA_REGULAR_22",
|
||||||
"type": "font"
|
"type": "font"
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ static const char *s_cos;
|
|||||||
static const char *s_tan;
|
static const char *s_tan;
|
||||||
|
|
||||||
// alarm drop menu options
|
// alarm drop menu options
|
||||||
static const char *s_options_type[3] = {"equilateral", "isosceles", "scalene"};
|
static const char *s_options_type[3] = {"acute", "obtuse", "right"};
|
||||||
static const char *s_options_function[3];
|
static const char *s_options_function[3];
|
||||||
static char *s_options_over[3];
|
static char *s_options_over[3];
|
||||||
static char *s_options_under[3];
|
static char *s_options_under[3];
|
||||||
|
|||||||
+2
-2
@@ -60,8 +60,8 @@ TriangleLayer *triangle_layer_create(GRect frame, GColor color) {
|
|||||||
// determine angles
|
// determine angles
|
||||||
uint8_t r1, r2;
|
uint8_t r1, r2;
|
||||||
do {
|
do {
|
||||||
r1 = 10 + (rand() % 151); // 10–160 (angle_A ≥ 10)
|
r1 = 5 + (rand() % 166); // 5–170 (angle_A ≥ 5)
|
||||||
r2 = (r1 + 10) + (rand() % (161 - r1)); // r1+10 … 170 (angles B,C ≥ 10)
|
r2 = (r1 + 5) + (rand() % (171 - r1)); // r1+5 … 175 (angles B,C ≥ 5)
|
||||||
} while (r1 == 60 && r2 == 120); // ensure never equilateral
|
} while (r1 == 60 && r2 == 120); // ensure never equilateral
|
||||||
|
|
||||||
tri->angle_A = r1;
|
tri->angle_A = r1;
|
||||||
|
|||||||
Reference in New Issue
Block a user