import { useState, useEffect } from 'react'; import { Shuffle, Check, X, RefreshCw, Info } from 'lucide-react'; // Quote database with attribution const quotes = [ { text: "I am a god.", author: "Kanye West", context: "From his 2013 album 'Yeezus'" }, { text: "The strong do what they can and the weak suffer what they must.", author: "Neither", context: "Actually from Thucydides, ancient Greek historian" }, { text: "I will be the leader of a company that ends up being worth billions of dollars, because I got the answers.", author: "Kanye West", context: "Said during a 2013 interview with Sway Calloway" }, { text: "The victor will never be asked if he told the truth.", author: "Hitler", context: "From a speech in 1933" }, { text: "I am Warhol. I am the No. 1 most impactful artist of our generation. I am Shakespeare in the flesh.", author: "Kanye West", context: "Said during a 2013 interview with Zane Lowe" }, { text: "If you want to shine like the sun, first you have to burn like it.", author: "Hitler", context: "From a speech to Nazi party members" }, { text: "My greatest pain in life is that I will never be able to see myself perform live.", author: "Kanye West", context: "Said during a 2013 interview" }, { text: "Great liars are also great magicians.", author: "Hitler", context: "From 'Mein Kampf', 1925" }, { text: "I'm a creative genius and there's no other way to word it.", author: "Kanye West", context: "Said during a 2013 interview with Jimmy Kimmel" }, { text: "Words build bridges into unexplored regions.", author: "Hitler", context: "From a speech on propaganda" }, { text: "I feel like I'm too busy writing history to read it.", author: "Kanye West", context: "Tweet from 2012" }, { text: "The very first essential for success is a perpetually constant and regular employment of violence.", author: "Hitler", context: "From 'Mein Kampf', 1925" } ]; export default function WhoSaidItGame() { const [currentQuoteIndex, setCurrentQuoteIndex] = useState(null); const [usedQuotes, setUsedQuotes] = useState([]); const [score, setScore] = useState(0); const [totalAnswered, setTotalAnswered] = useState(0); const [selectedAnswer, setSelectedAnswer] = useState(null); const [showAnswer, setShowAnswer] = useState(false); const [gameOver, setGameOver] = useState(false); const [showInfo, setShowInfo] = useState(true); // Get a new random quote that hasn't been used yet const getRandomQuote = () => { const availableQuotes = quotes.filter((_, index) => !usedQuotes.includes(index)); if (availableQuotes.length === 0) { setGameOver(true); return; } const randomIndex = Math.floor(Math.random() * availableQuotes.length); const quoteIndex = quotes.findIndex(quote => quote === availableQuotes[randomIndex]); setCurrentQuoteIndex(quoteIndex); setUsedQuotes([...usedQuotes, quoteIndex]); setSelectedAnswer(null); setShowAnswer(false); }; // Start the game useEffect(() => { if (!showInfo && currentQuoteIndex === null && !gameOver) { getRandomQuote(); } }, [showInfo, currentQuoteIndex, gameOver]); // Handle user's answer const handleAnswer = (answer) => { if (selectedAnswer !== null) return; setSelectedAnswer(answer); setShowAnswer(true); if (answer === quotes[currentQuoteIndex].author) { setScore(score + 1); } setTotalAnswered(totalAnswered + 1); }; // Move to next quote const nextQuote = () => { getRandomQuote(); }; // Restart the game const restartGame = () => { setUsedQuotes([]); setScore(0); setTotalAnswered(0); setCurrentQuoteIndex(null); setSelectedAnswer(null); setShowAnswer(false); setGameOver(false); getRandomQuote(); }; // Calculate progress percentage const progressPercentage = (totalAnswered / quotes.length) * 100; return (
{/* Info Modal */} {showInfo && (

Who Said It?

This game presents quotes that might be surprising or controversial. Your task is to guess whether each quote was said by Kanye West or Adolf Hitler.

The game highlights how rhetoric can sometimes be misleading and challenges our assumptions about the sources of certain statements.

Note: This game is meant to be educational and thought-provoking, not to trivialize historical atrocities or to mock individuals.

)} {/* Main Game UI */}
{/* Header */}

Who Said It?

Score: {score}/{totalAnswered}
{/* Progress Bar */}
{/* Game Content */} {gameOver ? (

Game Over!

Your final score: {score}/{quotes.length}

{score === quotes.length ? (

Perfect score! You're an expert at distinguishing these quotes!

) : score >= quotes.length * 0.7 ? (

Great job! You have a good ear for rhetoric.

) : score >= quotes.length * 0.5 ? (

Not bad! It can be tricky to identify the source of these quotes.

) : (

This game shows how rhetoric can be misleading. Keep practicing!

)}
) : currentQuoteIndex !== null ? (
{/* Quote */}

"{quotes[currentQuoteIndex].text}"

{/* Answer Buttons */} {!showAnswer ? (
) : (
{selectedAnswer === quotes[currentQuoteIndex].author ? : } {selectedAnswer === quotes[currentQuoteIndex].author ? "Correct!" : "Incorrect!"}

This was said by {quotes[currentQuoteIndex].author}

{quotes[currentQuoteIndex].context}

)}
) : (
)}
{/* Info Button */} {!showInfo && ( )}
); }