Blackjack program in java
First attempt at a Java Blackjack game. up vote 9 down vote favorite. 3. I just completed my first multi class program, Blackjack, and it works! It allows the user to play Blackjack against a single dealer, with no other players at the table. I was wondering, seeing as it is my first multi class program, if you could help me optimize it and/or. So I have a programming assignment to create a blackjack program. All I need to do is create the methods for it for the class BlackJackHand. Im pretty lost. Are my variables I have so far correct?. 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 .
Questions Tags Users Badges Unanswered. Are my variables I have so far correct? The exercise says that the subroutine should be a function that returns a boolean value with this information. It seems mostly internally consistent that's the important part , but does not really match what most Java programmers are used to. I know its daunting guys but I really need a little assistance.
I want to implement insurance and splitting, so any advice to help prepare the code for eventually adding those features would be really helpful! Finally, my main method is pretty long — I was wondering if this is typical of Java programs and, if not, how I can fix that.
I would add at a minimum a Hand , Player and HumanPlayer class. 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.
Jake moved towards him reluctantly. Спор. As he did this, he kissed her, ramming his tongue deep into her mouth. (This means that if you were in the hospital with two broken arms and the nurse washed you, it doesn't count, no matter how cute she was. Я начал играть с ним, водя по нему большим пальцем, и она снова кончила, когда я массировал её отверстие.
There are only two hard things in computer science: The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself. 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.
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? Making a simple blackjack game. 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. 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. 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.
I searched the web for a site that might list the black jack minimum bets for casinos on the strip, but have not had any luck. Just looking to play small at first, I have not played at a table much. The problem is the rules. Most will have rules that favor the house more than higher minimum tables. Make sure you check before sitting at a table. Wizard Of Odds has a Vegas blackjack survey on there site, it's mostly accurate This was during the week, though, may have been different on a weekend night.
Monte Carlo has them during the day i noticed. All of your saved places can be found here in My Trips. Log in to get trip updates and message other travelers.
Browse forums All Browse by destination. Save Topic Blackjack Minimum. Mentioned in this post. Fremont Hotel and Casino. Casinos in Las Vegas Casino at Luxor Las Vegas. Destination Expert for Las Vegas. MGM Grand Hotel and See All Las Vegas Conversations. The Venetian Las Vegas. All hotels in Las Vegas See all Las Vegas resources Provided by: Top questions about Las Vegas. Includes places to see and things to pack! Top 10 things to do and see Grand Canyon West; 3.
Where is the best burger? Craft Brews and Microbreweries Dining: How does it work? Downtown and Fremont Street- worth visiting? Pools; Pool Parties; which hotel? Bars and lounges- 1.
With a view; 2. High end to budget; Outlet Malls; Liquor stores Shows: When, where and how to buy tickets? Monorail, trams, buses and shuttles Transportation: Uber and Lyft- including discount codes Transportation: Taxis-how much does it cost for a taxi from the airport to the Strip?