Now write the outline of a Class called BulgarianSolitaire. Remember, what does this class need to "know" and what does it need
to "do"? I want you to write pseudo code for how this Class can play Bulgarian Solitaire with 45 cards. What is a triangular number???
1 answer:
Answer:
import java.util.ArrayList;
import java.util.Collections;
class Bulgarian
{
public static void main(String[] args)
{
max_cards=45;
arr->new ArraryList
col=1;
card=0;
left=max_cards;
do{
col->random number
row->new ArrayList;
for i=0 to i<col
{
card++
add card into row
}
add row into arr
left=max_cards-card;
}while(card<max_cards);
finish->false
while(!finish)
{
for i=0 to arr.size()
remove one card from each row
add row into arr
size->new ArrayList;
for i=0 to i<arr.size()
add arr[i] into size
sort(size)
for i=1 to size.size()
if ith element is equals to (i-1)+1
finish->true
else
finish->false
for i=0 to i<arr.size()
print->arr elements
}
}
}
You might be interested in
I don't really understand the meaning of the question. Can you reply and i'll try to help...
Answer:
save as a word document (.docx) to keep editing offline then copy and paste into the google doc
Answer:
false
because we are able to connect with people easily..
without have to wait for long time in the case of letters..
The answer will be google docs since it depends on a web and its an application. hope it helps