Here, I modeled the game of Bulgarian Solitaire. The code starts with N cards and randomly divides some number of piles of random size. Ex) The game begins with 15 cards, and you randomly get piles of sizes 7, 4, and 2. Then, the starting configuration would subtract one from each pile and create a new pile with the amount subtracted, so the example goes to 6, 3, 1, 3. The game ends when the piles have the sizes 1, 2, 3, 4, 5. The code starts with a random configuration and prints each step until the final result is reached.
The primary purpose of this assignment is to understand how to declare 1D array objects and manipulate elements in an array. The code has an interactive input that asks for a number. Then, all prime numbers leading up to it will be displayed with leading zeroes placed when necessary, as the numbers will be in decimal format.