+
+
+ {/* Seat numbers on outer boundary */}
+ {people.map((person, index) => {
+ const angle = (index * 360) / 16 - 90; // Start from top
+ const x = centerX + outerRadius * Math.cos((angle * Math.PI) / 180);
+ const y = centerY + outerRadius * Math.sin((angle * Math.PI) / 180);
+
+ return (
+
+ {person.id}
+
+ );
+ })}
+
+ {/* Plates */}
+ {people.map((person, index) => {
+ const angle = (index * 360) / 16 - 90; // Start from top
+ const x = centerX + radius * Math.cos((angle * Math.PI) / 180);
+ const y = centerY + radius * Math.sin((angle * Math.PI) / 180);
+
+ return (
+
+ {renderPerson(person)}
+
+ );
+ })}
+
+ );
+ };
+
+ return (
+
+ {/* Back to Puzzles button - only show when coming from puzzles */}
+ {isFromPuzzles && (
+
+
navigate('/themes/puzzles')}
+ className="text-primary hover:text-primary/80 font-medium flex items-center gap-2"
+ >
+
+ Go back to Puzzles
+
+
+ )}
+
+
+
+
+
+ The Plate Swap Puzzle
+
+
+
+ Arrange the plates so each person has their own plate. Pair people up and swap their plates!
+
+
+
+ {/* Game Controls */}
+
+
setShowRules(true)} variant="outline" size="lg" className="px-8">
+
+ Rules
+
+
+
+ Reset Puzzle
+
+
+ Moves:
+
+ {gameState.moves}
+
+
+
+
+ {/* Game Board */}
+
+ {renderTable()}
+
+
+ {/* Instructions */}
+
+
+
+ {gameState.isComplete ? (
+ "Congratulations! All plates are in their correct positions!"
+ ) : (
+ "Click on people to pair them up. All people without correct plates must be paired before swapping."
+ )}
+
+
+
+
+ {/* Swap Button */}
+ {!gameState.isComplete && (
+
+
+ SWAP
+
+
+ )}
+
+ {/* Legend */}
+
+
Legend
+
+
+
+
Person with wrong plate
+
+
+
+
Person with correct plate
+
+
+
+
Selected for pairing
+
+
+
+
Paired up (color-coded)
+
+
+
+
+
+
+
+
+ {/* Rules Dialog */}
+
+
+
+
+
+ The Plate Swap Puzzle Rules
+
+
+
+
+
Objective
+
Arrange the plates so that each person has their own plate (Person 1 has Plate 1, Person 2 has Plate 2, etc.).
+
+
+
+
Initial Setup
+
Each person starts with the next person's plate: Person 1 has Plate 2, Person 2 has Plate 3, ..., Person 16 has Plate 1.
+
+
+
+
How to Play
+
+ Pair people up: Click on two people to select them for pairing.
+ Swap plates: Click the SWAP button to exchange the plates of all paired people.
+ Repeat: Continue pairing and swapping until everyone has their correct plate.
+
+
+
+
+
Rules
+
+ People who already have their correct plate cannot be selected.
+ You must pair an even number of people to swap.
+ The SWAP button is only enabled when everyone is properly paired.
+ Try to solve the puzzle in as few moves as possible!
+
+
+
+
+
Strategy Tips
+
+ Look for cycles in the plate arrangement
+ Try to fix multiple people at once with strategic swaps
+ Plan your moves ahead to minimize the total number of swaps
+ Remember that each swap affects all paired people simultaneously
+
+
+
+
+
+
+ {/* Victory Dialog */}
+
+
+
+
+
+ Puzzle Complete!
+
+
+
+
+
+
+ Congratulations!
+
+
+
+ You solved the puzzle in {gameState.moves} moves!
+
+ {gameState.moves > 2 && (
+
+ Can you solve it in fewer moves?
+
+ )}
+
+ Play Again
+
+
+
+
+
+ {/* Attribution */}
+
+
+ {/* Social Share Section */}
+ {showSocialShare && (
+
+ )}
+
+ );
+};
+
+export default PlateSwapPuzzle;
\ No newline at end of file
diff --git a/src/pages/PlateSwapPuzzlePage.tsx b/src/pages/PlateSwapPuzzlePage.tsx
new file mode 100644
index 0000000..0e8f2e2
--- /dev/null
+++ b/src/pages/PlateSwapPuzzlePage.tsx
@@ -0,0 +1,12 @@
+import React from 'react';
+import PlateSwapPuzzle from '@/components/PlateSwapPuzzle';
+
+const PlateSwapPuzzlePage = () => {
+ return (
+