FAQ Database Discussion Community


Enum types may not be instantiated error

java,arrays,enums,playing-cards
I am making a basic card deck at the moment and I've encountered a problem using enums. How do I fix the following error(enum types may not be instantiated) in my code and get the value assigned to each enum public enum Rank { ACE(14), KING(13), QUEEN(12), JACK(11), TEN(10), NINE(9),...

Solitaire: storing guaranteed wins cheaply

space-complexity,playing-cards
Given a list of deals of Klondike Solitaire that are known to win, is there a way to store a reasonable amount of deals (say 10,000+) in a reasonable amount of space (say 5MB) to retrieve on command? (These numbers are arbitrary) I thought of using a pseudo random generator...

Setting 13 cards on screen in Android

java,android,android-imageview,playing-cards
> Im displaying 13 cards dynamically by getting Resource as string and setting its margin in a layout but they are not setting up without overlapping. I tried a lot by changing margin but not working. int counter=0; forloop 1 to 13 int resID = getResources().getIdentifier(resourceName, "id", getPackageName()); im =...

F# modeling playing cards

f#,playing-cards
I am trying to represent standard playing cards in F#. My goal is to implement a clone of Microsoft Solitaire (the one that comes with Windows) , a game in which Cards' Suit, Face, and Color are important. This exercise is mostly intended as a way to learn some F#....

(Java)How to change picture(War Card Game)

java,swing,user-interface,war,playing-cards
Ok what im trying to do is make a image called hidden and it will be a card face down. Now I want to make it so the image will change to a face up card and what i tried to do was make a image for six cards three...