Mind boggling card trick: Difference between revisions

m
Corrected spelling mistakes.
m (→‎{{header|Julia}}: Added forgotten import of the Random library)
m (Corrected spelling mistakes.)
Line 954:
System.out.println(System.lineSeparator() + "Number of cards are to be swapped: " + choice);
System.out.println("The respective zero-based indices of the cards to be swapped are:");
System.out.println(" Red : " + redChosenIndexes);
System.out.println(" Black : " + blackChosenIndexes);
for ( int i = 0; i < choice; i++ ) {
Line 963:
}
System.out.println(System.lineSeparator() + "After swapping cards the state of the red and black pilesspiles is:");
System.out.println(" Red : " + redPile);
System.out.println(" Black : " + blackPile);
int redCount = 0;
Line 984:
System.out.println("The number of black cards in the black pile: " + blackCount);
if ( redCount == blackCount ) {
System.out.println("So the asssertionassertion is correct.");
} else {
System.out.println("So the asssertionassertion is incorrect.");
}
}
Line 1,003:
Number of cards are to be swapped: 6
The respective zero-based indices of the cards to be swapped are:
Red : [4, 5, 6, 9, 0, 2]
Black : [1, 4, 10, 7, 3, 0]
 
After swapping cards the state of the red and black pilesspiles is:
Red : [R, R, R, R, R, R, B, R, B, R, B]
Black : [R, B, R, B, B, R, B, R, R, B, R, R, B, B, B]
 
The number of red cards in the red pile: 8
The number of black cards in the black pile: 8
So the asssertionassertion is correct.
</pre>
 
908

edits