Question: This is Bulgarian Solitaire with a 45 card deck, write in JAVA a program that will do the following: So your program should start with

This is Bulgarian Solitaire with a 45 card deck, write in JAVA a program that will do the following:

So your program should start with picking a random number piles and distributing the 45 cards among those piles.

Then call a method to start playing the game.

For each iteration of the game, print the piles. For example if you have 3 piles, one with 40, one with 2, one with 3 print this:

40 2 3

after each turn, sort the piles lowest to highest.

Your program should stop when you have this pile configuration:

1 2 3 4 5 6 7 8 9

For extra credit add an assertion.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!