Deck Of Cards- Blackjack?
Mar 1, 2009new to programming and I was wondering how would I make a deck of cards for a blackjack program? I would post some code but I don't know where to start
View 3 Repliesnew to programming and I was wondering how would I make a deck of cards for a blackjack program? I would post some code but I don't know where to start
View 3 RepliesOk here's what my code looks like as of now:
Private Sub btnDeal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDeal.Click
Dim RandomClass As New Random()
Dim RandomNumber As Integer[code].....
I have a standard deck of 52 cards is represented in an array. Each card is represented as an integer. I wrote the below function to shuffle the cards. Does the code below look ok?
Module Module3
Sub Main()
' initialize array
[Code].....
I have been working on a program in where i can add a deck, and then test it out, for various reasons. (Too much mana, not enough mana, ect.) and i have been wanting to add pictures so i could see what cards are popping up, but have no idea on how to do that. i can use my.resources to add pictures for my own cards, but i have no idea on how to go about giving the cards pictures.
Here is my code:
Public Class Form4
Public card1drawn As Integer = 0
Public card2drawn As Integer = 0
[CODE]...
I need to make a matching card game in VB 2010. i have generated my cards but now need to show the cards for 10 secs then change the cards to (AppPath & "Cards ed.png"). then when a user clicks on the card the card will flip over.*How would i set a timer to turn all my cards into*(AppPath & "Cards ed.png") after 10 secsbut still have the values from the array and when i click the cards they flip over (from red card to numbered card)
Code:
Private Sub Place()
Dim Counter As Integer = 1
For Row As Integer = 1 To Int_Grid_Size
[CODE]..........................
I'm in a bit of a bind with this project I'm currently working on. I'm making a 52 card deck counter, so the first code I whipped up was an array to create checkboxes for 13 cards of each of the 4 suits.
Dim x As Integer = 10
Dim y As Integer = 440
Dim width As Integer = 150
[CODE]............
The problem is I can't figure out for the life of me how to use the contents in cards(k, i). Anyone know how to initialize event handlers for that array of checkboxes?
Something like:
[CODE].........
But again, I have no clue how to get the script to detect when a cards(k, i) is checked.
I'm making a blackjack game for class. Your PlayingCard class totally rocks! I think I said that already Anyway, my board is set up very simply; the player and the dealer have hands with a limit of 5 cards, which I drew as picture-boxes. "sigh" I thought I had this all thought out; the LOGIC of the game was easy in C# console, but applying graphics just adds a whole other dimension to EVERYTHING!
1) Do I need to create an object for each picture-box?
2) How do I tell the program to use cards and their values created in the PlayingCard class to the picture-boxes?
Public Class FRM_BlackJack
'Global Variables
Dim PlayerCards(4) As PlayingCard.Hand
[code]....
I am making a simple blackjack game for school.It involves using object arrays and for next loops.I have 5 labels for the player, and 5 labels for the dealer. I have both their totals displayed on the form. I also have a deal, hit and stand button. I also need to follow the rules of if the dealer >= to 17 they must stand and if the dealer is < 17 they must hit. Does anybody have any suggestions on how i can code the dealers turn.I already made it so the player clicks hit and when he/she is done clicks stand. This is my stand button so far:
lblTotalDealer.Show()
lblD1.Show()
Dim itemarray2() As Label = {lblD1, lblD2, lblD3, lblD4, lblD5}
[code].....
My classmates said I was crazy when I told them I was re-making my old blackjack game in VB.It's actually been going a lot easier than it was when I was doing it in C#, though. I'm hitting some snags, which are commented on in the code. The basic logic is mostly right.My main question is how would I add images to the game? Where would I put them? How would I make sure the suits are randomized, too?
New Code:
Public Class FRM_BlackJack
Private Sub FRM_BlackJack_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
[code].....
I am having trouble with a blackjack game I am creating. I have buttons 1 - 13 (A-K) I have 5 Textboxes which when the above buttons are pressed displays the values in the textboxes. I also have one more textbox which adds up the values of the above 5 textboxes to give your Black Jack Total. The problem I have is if an Ace (11) is in one of the textboxes and the Total Value exceeds 21 i need to have the Ace (11) change its value to 1 instead.
textbox 1 - 5 will be the card values
textbox6.text will be the total Value
I have tried......
if textbox6.text > 21 then and textbox1.text = 11 then textbox1.text = 1
This seems to work fine however it only solves the problem of an Ace (11) appearing in textbox1.text so i tried to repeat the code with the other boxes...
if textbox6.text > 21 then and textbox1.text = 11 then textbox1.text = 1
if textbox6.text > 21 then and textbox2.text = 11 then textbox2.text = 1
if textbox6.text > 21 then and textbox3.text = 11 then textbox3.text = 1
[CODE]...
However this does not work and my program freezes?
I'm making a blackjack game for class. It's been better programming in VB than it has in C#, but I don't know how to link button subs (BTN_Deal_Click or BTN_Deal; I can't decide which one will work) to one another. For example, after the code in BTN_Deal has been run, the program is supposed to wait for the user to click either the Hit or the Stand button.
[Code]...
I need a small bit of help with my Black Jack game in VB 2005. Basically I have the game pretty much complete seems to work perfectly, I have two counters set up, one for dealers games won and the second one for players games won which both add up the results and displays them in a text box. I have another form made to display Statistics, for both 'This Session' and 'Overall', but how do I save the Overall score??
[Code]...
I'm sitting here with a print out of the class deck, class hand, and cardgameframework from the blackjack starter kit for visual basic and I'm lost as to where I need to go to use the above mentioned classes. I am looking to create a simple poker game using these classes as a base. I'm not looking for anything fancy, just something functional. Starting off I would like to hit a deal button and have it deal 5 cards into pictureboxes and then give me an option to (mouse click) hold any number from 0 to 5. Once I have clicked the cards to hold, I would like the program to deal new cards into the other pictureboxes. If I could get the program up to that point it would be a great place to start. Can anyone point me in the right direction? Has anyone used the cardgameframework before?
View 1 RepliesI am writing a blackjack game program in vb.net 2008. The program is designed to play 6 players per game in sequence using a pre existing algorithim (basic strategy). The program will play one game at a time using all 6 players or can be set to play 100 games using all six players and then capture the resulting data generated from each player from every card. When one game at a time is played the program works fine. When the program plays 100 games at a time it drops (loses) the data that is being stored in its string variable arrays.
View 1 RepliesI'm trying to make a light version of a Blackjack game. The rules I need to use are as follows:
Ace = 1
Normal Cards = 2-10
Color Cards (king, queen, etc,) = 11
The dealer can keep hitting until it reaches 17 or under 21, he must always stay once it hits 17 or over (without busting obviously).
I know the ace normally should be 1 or 11 normally but I don't want to complicate things, I want to get the main thing of the program working first.
Public Class frmMain
'declaration to help generate number
Dim RandomClass As New Random()
[code]....
I am trying to make a blackjack program and I need to execute a different piece of code each time a button is pressed by the user.
View 5 RepliesI need some code to get the cards out of cards.dll in VB.net. And do the cards have to go in a picture box?
View 2 Replieswhat is Wild cards how and when can i use the wild cards
View 1 RepliesI would like my website to accept credit cards online. I will manually process the payment. How can I make sure my website is secure to accept payments? Does VISA have specific requirements? Also, how can I check that the credit card information is valid?
View 1 Repliesbasically i've gotten myself into a mess with some last minute project work. shame on me and all that but thats college students for ya. basically i seem to be having problems assiging a simple integer to some pictures in an array. now. basically its a card deck. i've looked this up so many times yet nothing comes to me that fits my code or the way i've been taught. in any case i've got an imagelist and put it into an array to symbolize a deck. now. as i'm doing blackjack i need each card to have its own value. so obviously 2 of hearts value = 2, king = 10 etc.so what i've done is created a function that calls on a string. and used a select case to give a value based on the filepath of the image. however it failed hoplessly. heres a piece of the code:
Sub getcardvalues(ByVal card As String)
Select Case card
Case "decklist.images.item(2club.png)"
value = 2
[code]....
despite this seemingly simple solution i can't seem to pull out the path of these cards as a string. the array simply gives me a number and the actual picture dosnt want to be a string. so my question is this. how can i pull the image path out of the array (eg: deck(1) = decklist.images.item(3club.png)) and turn that into a useable string?
how to calculate how many cards are needed at least to make a straight in texas hold'em?
pratic examples:[code..]
I have to make a card game called SNAP. The point of the game is that two players will flip their card and if they match then one of them have to call out snap. The first one to call out snap gets the card.
I'm having trouble on getting the cards to generate randomly but match every now and then.
Ive got 16 cards to make 8 pairs (simple) ive got it to detect a pair by piccard1.image.TAG what i need to do is though, make the 'tag' part random, 0-15 so i can give each card a tag, but it has to be unique and i cant make it give 16 different number.
View 2 RepliesI have a program that I have been building for quite some time, which is sort of a media center type of program. One of the features it includes is a CallerID and call management system that I have integrated into it.I am actually turning the ringers off on my phones, and the program will have it's own ringer instead. One reason i'm doing that is, it is programmed only to ring if I actually have the number already in my phonebook (i.e. no more telemarketers), and other features like quiet time (after a preset time, let's say 11:00 the phone won't ring).So anyhow I have 2 sound cards in my system. One sound card is connected to my living room home theater, which would be for watching tv, movies, etc.The other sound card is going to a separate amplifier that will power speakers that are throughout the house. I want to be able to programatically tell my program to output sound on the secondary sound card.It will be just a simple wav file, and hopefully speech as well (using the system. speech.speech synthesizer).So no matter if your watching a movie, or playing xbox (meaning the stereo will no longer be playing audio from the computer),when the phone rings you will hear the ringer over the speakers, along with a voice saying "Joe Schmoe is calling".I don't know if I can specifically have it play certain sounds over one card, or if it is a per application setting.For instance, if you are watching a movie (meaning the movie is playing through the windows media player control, inside of my program), and the phone rings, I want the phone to ring on the other card without changing the audio from the movie. If i'm not able to do it that way, and if the program itself is only able to play through one card at a time, I will simply make the caller id portion it's own separate application, that way I could make it happen.
View 19 RepliesBelow is what I have so far this is a webproject, but its for my VB class so I'm not sure where else to post. The object is to create a program that randomizes 52 cards and based on the five cards it draws determine whether its 2 of a kind, three of a kind, straight, or flush.
Partial Class _Default
Inherits System.Web.UI.Page
Dim used(51) As Boolean
[Code].....
I need to enable /disable Nic I have a system with two nic cards "Local Area Connection" and Local Area Connection 2" my code will enable and disable the second nic no problem but when I try to disable /Enable "Local Area Connection" it sees the nic but disables "Local Area Connection 2" code to the Enable NIC.[code]...
View 5 Repliesi am working on a blackjack program, the dealers button works fine and all but when i press the button to hit me it says "Object reference not set to an instance of an object.", and i had it work before, but when it does work the aces either count as 11 or 0, and how can i get the value of the total amount of cards to reset.
View 24 RepliesI am using Visual studios 2010, And what I am trying to do is make a card game, and I have some ideas for how to put a lot of it together however I am having trouble getting started with making the cards to begin with.So I need something to call to represent the cards with numerical values with ace being 1 and king being 13.
View 4 RepliesI am creating a VB.Net program to deal out five random playing cards.For that purpose i checked the following tutorial - [URL]..It works great. But It has too much functionality I just want to get rid of the unwanted code to just dealing out 5 random cards. functions and classes from thius program that I should use.
View 2 RepliesI am working on a simple card game. I have done several in the past, but always by creating card images in a picturebox. I would like to call up the cards within the VISTA operating system. I get the following error:Unable to load DLL 'cards.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I have made the following declarations:
Inherits System.Windows.Forms.Form
Private w As Integer = 0
Private h As Integer = 0
[code]....
I am using VB EXPRESS 2008, (for the first time). As I recall, I did not have this problem in VB EXPRESS 2005.