interactives/src/pages/theme-pages/Puzzles.tsx
gpt-engineer-app[bot] d352192c9e Add Stacking Blocks interactive
Add "Stacking Blocks" interactive to the Puzzles page. This new interactive is based on the description provided in the attached screenshots.
2025-08-22 06:42:56 +00:00

122 lines
No EOL
4.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Layout from "@/components/Layout";
import InteractiveCard from "@/components/InteractiveCard";
import { useNavigate } from "react-router-dom";
const Puzzles = () => {
const navigate = useNavigate();
const puzzles = [
{
id: "pebble-placement",
title: "Pebble Placement Strategy Game",
description: "Place pebbles following specific rules to reach the furthest position possible. A strategic optimization puzzle!",
path: "/puzzles/pebble-placement",
tags: ["Strategy", "Logic", "Placement", "Optimization"],
difficulty: "Intermediate" as const,
duration: "5-15 min",
participants: "1 player"
},
{
id: "bulgarian-solitaire",
title: "Bulgarian Solitaire",
description: "Explore this fascinating mathematical puzzle where boxes rearrange themselves into a triangular configuration through iterative processes.",
path: "/puzzles/bulgarian-solitaire",
tags: ["Mathematical", "Solitaire", "Algorithm", "Convergence"],
difficulty: "Intermediate" as const,
duration: "5-10 min",
participants: "1 player"
},
{
id: "sikinia-parliament",
title: "Parliament of Sikinia Puzzle",
description: "Separate parliament members into two houses so each has at most one enemy in their house. A graph theory puzzle!",
path: "/puzzles/sikinia-parliament",
tags: ["Graph Theory", "Logic", "Coloring"],
difficulty: "Intermediate" as const,
duration: "5-20 min",
participants: "1 player"
},
{
id: "plate-swap",
title: "The Plate Swap Puzzle",
description: "Arrange plates around a circular table so each person has their own plate. A challenging permutation puzzle!",
path: "/puzzles/plate-swap",
tags: ["Logic", "Permutation", "Strategy"],
difficulty: "Advanced" as const,
duration: "10-30 min",
participants: "1 player"
},
{
id: "chessboard-repaint",
title: "Chessboard Repaint Puzzle",
description: "Repaint rows, columns, or 2×2 squares to achieve exactly one black square. A puzzle about parity and operations!",
path: "/puzzles/chessboard-repaint",
tags: ["Logic", "Parity", "Operations"],
difficulty: "Advanced" as const,
duration: "15-45 min",
participants: "1 player"
},
{
id: "knights-puzzle",
title: "Knights Exchange Puzzle",
description: "Can the black and white knights swap places using legal chess moves? A classic puzzle on a 3×3 board.",
path: "/knights-puzzle",
tags: ["Chess", "Logic", "Classic"],
difficulty: "Intermediate" as const,
duration: "5-15 min",
participants: "1 player"
},
{
id: "n-queens",
title: "N-Queens Puzzle",
description: "Place as many queens as possible on an n×n chessboard so that no two queens attack each other.",
path: "/puzzles/n-queens",
tags: ["Logic", "Chess", "Placement", "Classic"],
difficulty: "Intermediate" as const,
duration: "5-15 min",
participants: "1 player"
},
{
id: "stacking-blocks",
title: "Stacking Blocks Optimization",
description: "Split stacks of blocks to maximize your score! Each split earns points equal to the product of the new stack sizes.",
path: "/puzzles/stacking-blocks",
tags: ["Optimization", "Strategy", "Mathematical", "Algorithm"],
difficulty: "Intermediate" as const,
duration: "10-20 min",
participants: "1 player"
}
];
return (
<Layout>
<div className="py-12 px-4">
<div className="max-w-6xl mx-auto">
<div className="mb-8">
<h1 className="text-4xl font-bold text-foreground mb-4">Interactive Puzzles</h1>
<p className="text-muted-foreground text-lg">
Challenge your problem-solving skills with these educational puzzles designed to reinforce key concepts across multiple disciplines.
</p>
</div>
<div className="grid lg:grid-cols-3 md:grid-cols-2 gap-6">
{puzzles.map((puzzle) => (
<InteractiveCard
key={puzzle.id}
title={puzzle.title}
description={puzzle.description}
tags={puzzle.tags}
difficulty={puzzle.difficulty}
duration={puzzle.duration}
participants={puzzle.participants}
onClick={() => navigate(`${puzzle.path}?from=puzzles`)}
/>
))}
</div>
</div>
</div>
</Layout>
);
};
export default Puzzles;