teamdad Posted May 31, 2004 Posted May 31, 2004 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 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 :eek: Quote
Leaders Iceplug Posted May 31, 2004 Leaders Posted May 31, 2004 Let's see if I understand your problems ;). For problem 1, when you add a player, you want Itwo cards to be dealt just to the new player, or does every get Itwo new cards (easier). For problem 2, same as problem 1. Do the players get Itwo new cards, or do they just get/lose enough cards so that they have itwo cards. For problem 3, to generate numbers between two values: Dim Ri As Random = New Random X = Ri.Next(Lowest, Highest) :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.