|
-
May 30th, 2004, 11:35 PM
#1
Thread Starter
Lively Member
Card game help needed [Resolved]
I'm toying around with a numbers based card game I am making and I have hit a brick wall. Being kinda new to .NET isn't helping any either. Here's the plot for the settings of the game.
I have TextBox1, 2, 3, 4 and 5 that are inputs. 1 is for number of players, 2 is for the number of cards to be dealt each player, 3 & 4 are lowest & highest range of the face value of the cards that only use numbers ex: 02, 06, 08, 10, TextBox5 is the multiline output for the players and cards. In theory when the inputs have their variables entered they will be the controling factors for the program.
Dim Ione = TextBox1.Text
Dim Itwo = TextBox2.Text
Dim Ithree = TextBox3.Text
Dim Ifour = TextBox4.Text
Dim Ifive = TextBox5.Text
Dim r As New System.Random()
Dim Ifive = r.Next(Ithree, Ifour + 1)
Problem 1. Dynamically adding the number of players by the number input into Ione -each player is then represented by a diffrent row in Ifive since multiline is True. I havent been
able to come up with anything that will let me do this at all.
Problem 2. Same type of issue with Problem 1 above. The number of cards dealt to each player tells each row of Ifive how many individual cards it needs to contain and that each
card should be represented by a seperator with a specific format [the number] ex: bad visual output below.
Problem 3. Incorperate Ithree and Ifour into the calculation to randomly pick numbers from the range that become the cards selected to be given to each player.
In the below example:
Ione had the number 3 typed in for three players "three rows"
Itwo had the number 5 typed in for five cards dealt to each player "row 1, row 2 and row 3"
Ithree had the number 2 typed in for the lowest card value that could be dealt to each player
Ifour had the number 20 typed in for the highest card value that could be dealt
When Button1 is pressed it will tell Ione to create the three rows in Ifive, it will tell Itwo to tell each row in Ifive that they will be dealt 5 cards, Ithree and Ifour will tell each card what the face value will be. The output in Ifive should look something like this bad visual. All this should happen all at the same time with the one button clicked.
[02] [05] [07] [09] [10]
[04] [09] [11] [15] [20]
[08] [02] [16] [05] [18]
Eventually I will work with PrintDocument to print out the information for the number of players, cards they were dealt and who won. That's on the back burner till I can get this thing going. Now, is there anyone brave enough to either point me in the direction of combining all this information or better yet.... help me with code snippets that can get me started.
Thanks in advance to the brave that do end up helping me
Last edited by teamdad; Jun 13th, 2004 at 08:19 PM.
-
May 31st, 2004, 02:45 PM
#2
PowerPoster
Hi,
I can't quite understand waht you are trying to achieve, so let us take it one step at a time.
Firstly,
Why are you ignoring the Jack Queen & King? Is it because you thinke there will be problems with coding or are they genuinely left out of the game?
Second.
Don't you think it is more lifelike to create a pack - random if you wish but you can easily do a shuffle routine_ and then deal from the top, rather than randomise each card dealt?
Now, to your stated problems:
"Dim Ione = TextBox1.Text" etc
You should be getting an intellisense warning that this is not acceptable coding.
do you mean
Dim Ione as String = Textbox1.Text? or
Dim Ione as Textbox =Textbox1?
When you say
"each player is then represented by a diffrent row in Ifive since multiline is True"
If Ione is a string variable, it can hardly be multiline. If you want a string to subsequently be displayed on multilines, then you will have to use a delimiting character.
Come back with the answers and we will see where we go.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|