No Download /Java / Flash Blackjack

Welcome to JavaRanch, Sanne! The user gets to decide again whether to Hit or Stand. In outline, the game goes like this: Return the boolean directly The following: Use already existing wheels You can shuffle the deck by using the built-in: Making a simple blackjack game. There is a setValue method, which you don't need either.

Your Answer

Online Blackjack Guide for September 2018

So long as the developer uses Java and the consumer has Java installed to their computer, the games will run. Java is standard for a lot of applications. You probably have Java installed on your computer already — you just might not realize it.

All operating systems are compatible with Java. You can download Java to your Windows, Mac or Linux operating system. Because online casino software is heavy. In fact, you might only want to play blackjack. So why bother downloading all of those files that can slow down your computer and take up space you could use elsewhere, when you could just log-in to the casino from your browser and play there — without having to download anything?

Getting started is very simple. Assuming you already have Java downloaded to your computer, all you need to do is:. You can just choose the game you want to play and start playing.

Maybe I just have to learn more. With a proper OO design, you should only have to return one thing. You should be able to create a 'card' class that would hold the rank A-K and a suit. I would NOT have it return a value, since the value is not a property of the card, but of the rules of the game of blackjack.

Welcome to JavaRanch, Sanne! I agree with Fred. It's probably easiest if you create a Card class. This is my code: Nobody here is going to laugh at you. If they do, let a moderator know, and we'll smack them down. The idea is that a method should do one simple thing, and do it well. And methods can of course call other methods.

So you may have a method called 'getValueOfHand'. There are more classes you could create, but this would be a good start.

In fact most of the other comments in the code don't add value either. The best code doesn't need comments. Look through all the comments in your code, if they are not needed, then remove them, if they are needed, then try to change the code in a way to not need comments. Will it make sense for rank , suit and value to change in the lifetime of a Card instance?

So make these fields final. There is a setValue method, which you don't need either. Review the other classes too. Make everything final that doesn't need to change or doesn't make sense to ever change. This practice can help you spot some design bugs. If you want to iterate over the possible suits, you can do for Suit suit: There are too many magic numbers in the code.

It would be better to put these in public static final variables with descriptive names, to clarify the purpose of these values, have them together near the top of the code for easier control and flexibility to play with. The code doesn't follow the common formatting generated by the auto-format option of common IDEs like Eclipse and IntelliJ.

I suggest to reformat the entire thing, to make the code look more familiar and easier to read for the majority of Java coders. In Eclipse the keyboard shortcut is Control-Shift-f. The same goes for public static boolean hasBlackJack int handValue and public static boolean isHitorStand String hitter and public static boolean checkBust int handvalue for the latter you should move printing out of the function.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies. Home Questions Tags Users Unanswered. First attempt at a Java Blackjack game Ask Question. If a jack, queen, or king the value is ten. Aces are 11 for now. Takes into account the value of aces.

Best Blackjack Casinos Online

Leave a Reply