Post: No repetition without an array?
11-03-2013, 06:21 AM #1
FunnyFunkyCow
You talkin to me?
(adsbygoogle = window.adsbygoogle || []).push({}); I have to create a program that draws 20 cards out of a standard deck without repetition and I'm not allowed to use an array (or anything I haven't learned in class yet).

My program is pretty simple, got a random number 1~13 (face value) and renamed each number as a String with a switch case in my first method. In second method I have the same thing but 1~4 (suit value). Then my driver is simply showing the face value+" of "+suit value.

Any methods of removing the repetition (would have to be very basic methods) would be greatly appreciated. Tips and ideas will also be helpful!

(Java btw)

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo