Sanne Gloeric

Greenhorn
+ Follow
since Feb 25, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sanne Gloeric

Thank you.

I wrote the java code in English. Please don't laugh at my very-beginner simple code (or don't laugh to hard)
I'm trying to learn java on my own. So if anyone would tell me if this a logic structure/solution I would appreciate it very much. The code does work.

If I would make one method to generate a card, should I use an other method to determine the value and one to determine if it's a ace or not?
Or do I make it more difficult than I should by using multiple methods for a simple game?

This is my code:

13 years ago
I'm trying to make a very simple blackjack game to play against the computer.

I now made it, without using GUI in one class. It's quite big and now I want to try to make it possible to split. However, I would like to make methods like "drawcard". (Now I use a switch for this) and call the "drawcard" method in the main class.
But, if I place my switch (drawcard) in an method in an other class, I can only return 1 variable, and I want to return more (the name of the card, the points you get by it and if it's a ace or not.)

I just started with learning Java so sorry if I don't use the correct terms. I can copy the code I have now, but then I have to translate some names of variables and text . (it's now Dutch). Could I just copy the Javacode in the message?

Could anybody give me some advise if I should use more classes or not? Maybe I just have to learn more.
13 years ago