import { useState, useEffect } from 'react'; import { Shuffle, Check, X, RefreshCw } from 'lucide-react'; export default function KanyeOrHitlerGame() { const [quotes, setQuotes] = useState([ { text: "I am a god.", author: "Kanye", source: "Yeezus album, 2013" }, { text: "I will be the leader of a company that ends up being worth billions of dollars, because I got the answers.", author: "Kanye", source: "Interview with Sway, 2013" }, { text: "My greatest pain in life is that I will never be able to see myself perform live.", author: "Kanye", source: "VH1 Storytellers, 2009" }, { text: "I am Warhol. I am the number one most impactful artist of our generation. I am Shakespeare in the flesh.", author: "Kanye", source: "Interview with Sway, 2013" }, { text: "The greatest accomplishment in life is not being successful, but being influential.", author: "Kanye", source: "Twitter, 2018" }, { text: "Great liars are also great magicians.", author: "Hitler", source: "Mein Kampf, 1925" }, { text: "If you tell a big enough lie and tell it frequently enough, it will be believed.", author: "Hitler", source: "Attributed in propaganda discussions, 1941" }, { text: "The victor will never be asked if he told the truth.", author: "Hitler", source: "Speech in Munich, 1936" }, { text: "Words build bridges into unexplored regions.", author: "Hitler", source: "Mein Kampf, 1925" }, { text: "The art of leadership consists in consolidating the attention of the people against a single adversary.", author: "Hitler", source: "Mein Kampf, 1925" } ]); const [currentQuote, setCurrentQuote] = useState(null); const [score, setScore] = useState(0); const [totalGuesses, setTotalGuesses] = useState(0); const [showAnswer, setShowAnswer] = useState(false); const [userGuess, setUserGuess] = useState(null); const [gameOver, setGameOver] = useState(false); useEffect(() => { if (!gameOver) { getRandomQuote(); } }, [gameOver]); const getRandomQuote = () => { if (quotes.length === 0) { setGameOver(true); return; } const randomIndex = Math.floor(Math.random() * quotes.length); const selected = quotes[randomIndex]; // Remove the selected quote from the array const updatedQuotes = [...quotes]; updatedQuotes.splice(randomIndex, 1); setQuotes(updatedQuotes); setCurrentQuote(selected); setShowAnswer(false); setUserGuess(null); }; const handleGuess = (author) => { if (showAnswer) return; setUserGuess(author); setShowAnswer(true); setTotalGuesses(totalGuesses + 1); if (author === currentQuote.author) { setScore(score + 1); } }; const nextQuote = () => { if (quotes.length === 0) { setGameOver(true); } else { getRandomQuote(); } }; const resetGame = () => { setQuotes([ { text: "I am a god.", author: "Kanye", source: "Yeezus album, 2013" }, { text: "I will be the leader of a company that ends up being worth billions of dollars, because I got the answers.", author: "Kanye", source: "Interview with Sway, 2013" }, { text: "My greatest pain in life is that I will never be able to see myself perform live.", author: "Kanye", source: "VH1 Storytellers, 2009" }, { text: "I am Warhol. I am the number one most impactful artist of our generation. I am Shakespeare in the flesh.", author: "Kanye", source: "Interview with Sway, 2013" }, { text: "The greatest accomplishment in life is not being successful, but being influential.", author: "Kanye", source: "Twitter, 2018" }, { text: "Great liars are also great magicians.", author: "Hitler", source: "Mein Kampf, 1925" }, { text: "If you tell a big enough lie and tell it frequently enough, it will be believed.", author: "Hitler", source: "Attributed in propaganda discussions, 1941" }, { text: "The victor will never be asked if he told the truth.", author: "Hitler", source: "Speech in Munich, 1936" }, { text: "Words build bridges into unexplored regions.", author: "Hitler", source: "Mein Kampf, 1925" }, { text: "The art of leadership consists in consolidating the attention of the people against a single adversary.", author: "Hitler", source: "Mein Kampf, 1925" } ]); setScore(0); setTotalGuesses(0); setGameOver(false); setShowAnswer(false); setUserGuess(null); }; return (
Your final score: {score}/{totalGuesses}
"{currentQuote.text}"
{userGuess === currentQuote.author ? "Correct!" : `Wrong! This was said by ${currentQuote.author}.`}
Source: {currentQuote.source}
Loading quotes...
)}Note: This game is meant to highlight the sometimes shocking similarity between quotes from very different public figures. It is not intended to equate or compare the individuals themselves.