-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44b0ca5
commit 140d48f
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/programming/school/student/dylan/Lesson10Tarok.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package programming.school.student.dylan; | ||
|
||
import java.util.Random; | ||
|
||
import programming.school.tarok.TarokDeck; | ||
import programming.school.tarok.TarokSet; | ||
|
||
public class Lesson10Tarok { | ||
|
||
public static void main(String[] args) { | ||
|
||
// He is so strongeus! | ||
Random randoguys = new Random(); | ||
randoguys.nextInt(6); | ||
|
||
// Create a deck, fully sorted. | ||
TarokDeck t = new TarokDeck(); | ||
|
||
for (int i=0; i<1000; i++) { | ||
t.swap(randoguys.nextInt(54), randoguys.nextInt(54)); | ||
} | ||
|
||
// Print out the deck. | ||
System.out.println(t); | ||
|
||
// Deal 12 cards. | ||
TarokSet h = t.deal(12); | ||
|
||
// Print them out. | ||
System.out.println(h); | ||
|
||
// Swap the cards at index 0 and 6. | ||
|
||
for (int i=0; i<1000; i++) { | ||
h.swap(randoguys.nextInt(12), randoguys.nextInt(12)); | ||
} | ||
|
||
// Print them out. | ||
System.out.println(h); | ||
} | ||
} |