Increase type diversity (increased chance of obtuse triangles)

This commit is contained in:
2026-08-07 19:09:30 -04:00
parent 815018427f
commit d4f91ab171
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -60,8 +60,8 @@ TriangleLayer *triangle_layer_create(GRect frame, GColor color) {
// determine angles
uint8_t r1, r2;
do {
r1 = 10 + (rand() % 151); // 10160 (angle_A ≥ 10)
r2 = (r1 + 10) + (rand() % (161 - r1)); // r1+10 … 170 (angles B,C ≥ 10)
r1 = 5 + (rand() % 166); // 5170 (angle_A ≥ 5)
r2 = (r1 + 5) + (rand() % (171 - r1)); // r1+5 … 175 (angles B,C ≥ 5)
} while (r1 == 60 && r2 == 120); // ensure never equilateral
tri->angle_A = r1;