From 179fcef3dbeba5963a0a66789ab86bf586c25e62 Mon Sep 17 00:00:00 2001 From: Blizzard Finnegan Date: Tue, 21 Dec 2021 13:46:04 -0500 Subject: [PATCH] Start day21 --- day21/day21Part1.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 day21/day21Part1.cpp diff --git a/day21/day21Part1.cpp b/day21/day21Part1.cpp new file mode 100644 index 0000000..b9990cd --- /dev/null +++ b/day21/day21Part1.cpp @@ -0,0 +1,32 @@ +#include + +using namespace std; + +int main (void) +{ + int player1Position = 4; //This is for both test and true input + int player1Score = 0; + int player2Position = 8; //This is 5 for true, 8 for test + int player2Score = 0; + int dieRoll = 0; + int dieRollover = 0; + int turnAdd = 0; + bool player1Add = true; + while (player1Position >= 1000 || player2Position >= 1000) + { + if ((dieRoll % 3) == 0) + { + if (player1Add) + { + player1Position = player1Position + ((turnAdd % 10) + 1); + player1Score += player1Position; + } + else + { + } + } + } + + // TODO : Multiply loserScore by (100 * dieRollover) + dieRoll + return 0; +}