I am currently writing a program for simulating an UNO card game and I am having some difficulty with writing a couple a methods in terms of dealing and shuffling the decks. My code is provided below:
To make it short and sweet... the problem the compiler has is in the randomDeal() method. The compiler says that an int cannot be dereferenced. I know it's something simple I am forgetting but I can't for the life of me figure it out. It has to be something simple that I am missing or forgetting. Does anyone have any ideas?
All your suggestions/help/improvements are greatly appreciated!
Excellent, I'm glad you got it sorted. And kudos for telling us what the problem was and how you fixed it, that is really valuable to the forum.
As a couple of points of style:
- You don't need the 'this' keyword when calling methods from within the same class
- Class names should not contain any non alphanumeric characters, so Sim_Actions should be SimActions. Both are valid Java but the latter is considered better style.
Tim Driven Development
posted 4 years ago
Thanks for the suggestions. I will keep that in mind.
I am always learning new things with programming, no matter how long I have been doing this