From 54b812c0d007bf54bc8eb4881ce88a3c3bd8b299 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Sat, 11 Apr 2026 12:06:29 +0700 Subject: [PATCH] Gameplay --- Form1.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Form1.cs b/Form1.cs index a4a46aa..2f46ab5 100644 --- a/Form1.cs +++ b/Form1.cs @@ -28,5 +28,37 @@ namespace GuessTheCard { PlayRound(0); } + + private void PlayRound(int guess) + { + int newDice = random.Next(1, 7); + bool isCorrect = false; + + if (newDice > previousDice) + { + isCorrect = (guess == 1); + } + else if (newDice < previousDice) + { + isCorrect = (guess == 0); + } + else + { + isCorrect = true; + } + + if (isCorrect) + { + score += 5000; + } + else + { + score = 0; + } + + previousDice = newDice; + labelCard.Text = "Result : " + newDice; + labelScore.Text = "Score: " + score; + } } }