2008 - Draw Random Numbers From Comboboxes For Dealing Cards

Jan 23, 2009

I'm trying to make a program that'll play the card game "War". I've started to code the dealing process, but it doesn't seem to be working. I currently have 3 comboboxes on the form each with numbers representing different cards, 1 that contains all the cards to be dealt, 1 that contains the user's cards, and 1 that contains the computer's cards. I plan to just draw random numbers from these comboboxes for the dealing. However, nothing happens when I click the tool-strip button that's supposed to deal the cards. [Code]

View 5 Replies


ADVERTISEMENT

Random Numbers For Cards?

Feb 27, 2009

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 Replies

VS 2008 : Dealing With Large Numbers?

Mar 12, 2012

I want a method of dealing with very, very, very big numbers (potentially a million digits). It is very cumbersome to deal with very big numbers in VB, would another language perhaps be better for that?

View 10 Replies

Random Playing Cards Deal?

Nov 4, 2010

I 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 Replies

Game Programming :: Make A Matching Card Game In VB 2010 - Show Cards For 10 Secs Then Change Cards To (AppPath & "Cards Ed.png")

Apr 19, 2012

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]..........................

View 2 Replies

Dealing With HUGE Numbers

Sep 21, 2009

I've been messing around with prime numbers for a while now, but I now want to use massive numbers, say a few million digits in length. Is there a way of storing and performing mathematical functions with such large numbers? Is it even possible on my home computer? I read on another old thread, something about a big number library, but the links he gave are now dead.

View 4 Replies

Game Programming :: Program Is Designed To Generate A Random Hand Of Cards Out Of Our List?

Aug 19, 2008

Below is the code that we have been working on. We have bolded the parts which we are unsure about - they are producing errors. (its near the bottom)The program is designed to generate a random hand of cards out of our list of them. This program is a smaller version of what we hope to have in the full one - ie. It tries to get a random hand of 3 cards out of a possible 5.

The part we are having errors with is getting the images to display on each of the 3 'picturebox' objects using a loop (so we don't have to type each picturebox individually).

[Code]...

View 8 Replies

VS 2010 Draw Rectangle (random Times, Random Location)?

Nov 26, 2011

I am practicing using the drawing commands, and have gotten a grass background and black happy face that moves around the background.It's a 10x10 grid of 50 pixels.I want (at the moment, when i press enter) it to generate a random number of trees (15 ~ 25) at random locations on the background. The program doesn't freak out about anything, and the variables seem to be right (using stop commands) but it's not drawing anything. Here is the code for the "GenerateTrees" command I have for when I press enter.

Private Sub GenerateTrees()
NumberOfTrees = Int(Rnd() * 10) + 15
For i = 0 To NumberOfTrees - 1
bmap.MakeTransparent(Color.Fuchsia)

[code].....

View 4 Replies

Formula Or Convention When Dealing With Inclusive Numbers

Oct 3, 2010

I addressed a meeting and used the following....she worked there for 17 years.I was corrected later that it should have been 16 years.I argued that the first year of this persons employment was 1966 and her last years work was 1982. Therefore 17 years.Does someone have an articulate mathmatic reasoning that explains dealing with inclusive numbers.

View 12 Replies

VS 2008 Getting 2 Different Random Numbers

Sep 26, 2010

I am trying to do a turn-based battle. I want enemyhit to be a random number between enemyminhit and enemymaxhit, and I want playerhit to be a random number between playerminhit and playermaxhit. The numbers are random, but my problem is that enemyhit and playerhit always seem to be the same, or close to the same.

[Code]...

View 3 Replies

VS 2008 Get Random Characters And Numbers?

Jul 12, 2009

Does anyone know how to do the following:Get a string with with random characters and numbers in it?I want the string to be 6 characters long.

Basically, when a button is clicked, i want to fetch random letters and numbers and assign them to a string.

View 1 Replies

VS 2008 How To Generate Random Numbers

Nov 22, 2011

i'm programming sudoku game for my vb 8 class.but i don't know how to generate random numbers, i think that i've to use random or randomize, but i don't know how to use them, i've been looking around but i can't find an answer.and i only have this week to program it

View 10 Replies

VS 2008 Random Numbers No Repeats

Feb 3, 2010

I am trying to write a program that gives a random number with out repeats the limit is 60 right now. I get a System.StackOverflowException error randomly sometimes it could be 5 numbers in it could be 50. also it will repeat some numbers. Ive been looking over it and it looks like it should work to me idk why its not.

BTNgen calls this sub.

Private Sub gen()
If y = usedcountries.Length - 1 Then
BTNgen.Enabled = False

[Code]....

View 6 Replies

VS 2008 Random Text And Numbers?

Dec 21, 2009

What would I put when I want it to generate random numbers and text, and has a - at the end. I know it's pretty simple but I can't think of how I would do it.

So 5 random numbers/and or text and a - at the end. So like this

View 8 Replies

VS 2008 - Finding 3 Equal Numbers Out Of 5 Random

Apr 23, 2011

I have a program I'm working on (a chance game) that has 5 random numbers generated. I need to think of an expression to check to see if three of those numbers are equal. The random values are not an array, they are 5 separate variables. I have the code written to compare if there are two matching ones, but am having trouble thinking past that. [Code]

View 3 Replies

VS 2008 Make Sure Random Numbers Do Not Repeat?

Oct 14, 2009

I have done this code but what is a smart way to get rid of repeats?

card1 = random.Next(0, 52)
card2 = random.Next(0, 52)
card3 = random.Next(0, 52)

[Code].....

View 4 Replies

[2008] Generating Random Letters And Numbers?

Feb 20, 2009

is there a code for generating random letters and numbers?? like between 0 to 9 and A to F??
I used this code :

[Code]...

View 5 Replies

VS 2008 Button Click Generates 4 Random Numbers

Jul 28, 2009

How can I make a command button, When clicked, Generate 4 random digit numbers? such as 5545 or 7492, Any random 4 digits.

View 13 Replies

Bug In VB 2010 RC - Class Random - Always Produces The Same Random Numbers In The Same Sequence

Apr 4, 2010

The class Random is out right defective. It always produces the same random numbers in the same sequence. Things I have tried so far is every kind of seed you can think of as well as Randomize. The result is that I always get the same random numbers in exactly the same sequence.

View 4 Replies

VS 2008 - Generating Random Amount Of Numbers And Letters In Form

Dec 24, 2009

I am using Visual Basics 2008 Express edition. I want my program that I am making to generate a random amount of numbers and letters in this form when I click Button1.
WM9RX-GG6J2-4WKD9-FDJWM-TYH76
Is this possible?

View 8 Replies

VS 2008 Random Number Generator - Store Generated Numbers?

Nov 23, 2010

Right so my generator is working, but I now want to take the numbers that it generates and add them to a list of generated numbers. So you can monitor what numbers have been generated. then ideally a way to exclude these numbers from being generated again.

[Code]...

View 34 Replies

Use .next (random Numbers) To Randomly Select Something From A List Of Numbers But It Can't Repeat The Number?

Aug 16, 2009

So how would I use .next (random numbers) to randomly select something from a list of numbers but it can't repeat the number?I could do:

dim num as integer
dim r as new random
num = r.next(1,5)
if num = 1 then
elseif num = 2 then
etc.

That wouldn't work because it would repeat.If I donwload someone's game can I disect it in VS? :0 I tried going to open project, then I went to the folder and clicked open. It brought me inside of the folder so I tried to open the game but there is no form1 there. It says the games name then .exe in the explorer-like thing in the top right?Also, how would I have a value or something in a label and access it from a button.

Example:This is in a label.

Dim number as Integer
number = 0

Then in the button do

Label.number = 0

How would I do something like that? I want to use that a lot as I did in a different language.

View 6 Replies

Generate 6 Unique Random Numbers - Sometimes Get Duplicate Numbers ?

Oct 6, 2011

The program must generate 6 unique random numbers but when I click display numbers sometimes it gives me 6 unique numbers and sometimes I get duplicate numbers. I will add the code I have so far.

Public Class frmMain

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

[CODE]...

View 9 Replies

Random Numbers And Random Strings

Nov 24, 2009

I don't take programming lessons at school or anything, and I'm starting to (try to) teach myself about random things.Currently I'm making an app that has 3 functions:

-Random Integer (1 to 100)
-Random Answer (Yes or No, similar to a coin flip)
-Random Dice Roll (1 to 6)

How would I go about doing this?At the moment all I know about random numbers etc. is that I will need to do something along the lines of Dim dice As New Random or something like that, but, like I mentioned, I have no idea.I am well aware of the DIC rules that you won't write the code for me/do my "homework(?)" for me, and that's not what I'm asking.

View 2 Replies

Divide Two Numbers Together And They Should Be 2 Random Numbers From 1-12?

Jan 10, 2010

Basically, I want to divide two numbers together and they should be 2 random numbers from 1-12 (I have done that part) but, the answer should be a whole number (i.e. Integer, so no decimal points etc) So, I did the following:

' Initialize the random-number generator.
Randomize()
' Generate random value between 1 and 12.
Dim value5 As Integer = CInt(Int((12 * Rnd()) + 1))

[code]....

but the problem here is that the program crashes after only a few clicks on the button. So I guess the question is: How can I make the program generate two numbers (from 1-12) that when divided become a whole number?(Is there any code that may tell the random generator that I want the numbers to be even?-so all even numbers from 1-12?)

View 2 Replies

IF Statement Dealing With "between Numbers"?

Mar 14, 2012

I really don't know how to put this in ... but i will do my best. what i am trying to do is basically build a statement that looks at a number and if its between number 1 and number 8 then the output would be " this is class C network " and if the number is between 9 and 16 the output would be " This is Class B Network"and finally if the number is between 17 and 24 the output should be " this is Class A Network"

this is the code that i got it to work except that part i have explained above :

[Code]...

View 2 Replies

Draw A Random Triangle In A Timer?

Sep 26, 2009

i'm trying to draw a random triangle in a timer, + draw an arc + the angle in degrees in each angle. i can't get drawarc working.

heres my code:

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code].....

View 4 Replies

Make A Program That Will Draw 700 Random Lines On It Initially?

Oct 17, 2010

I am currently using Visual Basic 2008 Express Edition.I want to make a program that will draw 700 random lines on it initially. I tried my code but the lines only appear in the same way such as straight line and diagonal line. Here's my code:

Public Class Form1
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

[Code].....

View 3 Replies

Draw A Random Sized + Shaped Triangle , Centered In My Picturebox?

Sep 25, 2009

How can i draw a random sized + shaped triangle, centered in my picturebox?

heres the code i wrote, but it draws them too big + off the screen or too small. how can i draw medium sized triangles centred in my picturebox?[code]...

View 18 Replies

Get 7 Different Random Numbers?

Jul 3, 2009

i want to know how to generate 7 "differents" random numbers.

I need to use a tab() with 7 entries and verify(with a loop?) if the generated number is or not present in the the table, if not then increment a counter by 1 and add the number in the table and increment the table position by 1 for the next randomized number.

Im not sure how to do the verification, so far all i have is a function i made for the random number between min and max:

Private Function randGen(ByVal min As Integer, ByVal max As Integer)
Dim random As New Random()
Dim i As Integer

[Code]....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved