From 361aaf9000e02e69b967f8de21b71fbc80ecdfa7 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 07:08:34 +0000 Subject: [PATCH] Fix graph spacing and edge labels Adjust graph to full width and reduce edge constraints to improve spacing and clarity. --- src/components/DogsBunnyPuzzle.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/DogsBunnyPuzzle.tsx b/src/components/DogsBunnyPuzzle.tsx index 603b553..0b8fb8e 100644 --- a/src/components/DogsBunnyPuzzle.tsx +++ b/src/components/DogsBunnyPuzzle.tsx @@ -78,25 +78,27 @@ const DogsBunnyPuzzle: React.FC = ({ // Connect all locations with conditional edges for (let i = 0; i < locations.length; i++) { for (let j = i + 1; j < locations.length; j++) { - const numConditions = diff === 'easy' ? 1 : diff === 'medium' ? 2 : 3; - const conditions: string[] = []; - - for (let k = 0; k < numConditions; k++) { - const conditionType = locationTypes[Math.floor(rng() * locationTypes.length)]; - const prefix = conditionPrefixes[Math.floor(rng() * conditionPrefixes.length)]; - conditions.push(`${prefix} ${conditionType.toUpperCase()}`); + const FREE_RATIO = 0.33; + let conditions: string[] = []; + if (rng() >= FREE_RATIO) { + const numConditions = diff === 'easy' ? 1 : diff === 'medium' ? 2 : 3; + for (let k = 0; k < numConditions; k++) { + const conditionType = locationTypes[Math.floor(rng() * locationTypes.length)]; + const prefix = conditionPrefixes[Math.floor(rng() * conditionPrefixes.length)]; + conditions.push(`${prefix} ${conditionType.toUpperCase()}`); + } } edges.push({ from: locations[i].id, to: locations[j].id, - conditions: conditions + conditions }); edges.push({ from: locations[j].id, to: locations[i].id, - conditions: conditions + conditions }); } } @@ -339,7 +341,7 @@ const DogsBunnyPuzzle: React.FC = ({ -
+
{/* Puzzle Area */}
= ({
{/* Instructions & Controls */} -
+

How to Play: