VS 2010 Shuffle Up And Deal Program Would Like Advice?

Nov 10, 2011

I have handed this assignment in and it works albeit not in the most elegant way. I am taking my second programming class ever and I would love for some feedback and answers to a few questions i have. First, what would be a better way to display the correct image to the corresponding card. Using all those if statements seems ridiculous, but i cant see a way around having card 1 possibly equal each value from every suit, card 2 equal each value from every suit, etc.

Second, my professor wants us to be able to record the seed value so that we could then plug it back in and return the hand that was shown when it was created. i have done this but I am a bit confused. The seed shows up as a value from 0-999, but when you use the combination formula to figure the total possible amount of hands you get over 2.5 million. Since i only have 1000 seed values does that mean that multiple hands might share the same seed value or does that number (0-999) mean something different eache time? Sorry if my explaination seems confusing.

Third, I am always looking for advice on better ways to do things. If anyone has free time and would like to offer constructive critisism I would be grateful.Below is the code. I only left in picturebox display for 1 suit so as to shorten the total amount shown. I also removed code for other buttons and stuff.

Public Class Form1
Private Sub btnShuffle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShuffle.Click
' Variable Declarations
Dim intSuit As Integer ' Row
Dim intCardValue As Integer ' Column

[Code]...

View 4 Replies


ADVERTISEMENT

Program To Deal With Sine/cosine Functions?

Jun 2, 2009

I am making a program to deal with sine/cosine functions

If rdbsideA.Checked = True Then
Do While AngleB > 0
SideA = (SideB * Math.Sin(txtAngleA.Text)) / Math.Sin(AngleB)
Loop
MsgBox("The Length of Side A is ", SideA)
End If

That is if the user seleects to find side a. When the messagebox pops up, it doesnt state the previous calculation, why is that?

View 10 Replies

Mix And Match Discount Code Advice

Jul 20, 2010

I need advice on how to implement. I have two objects ReceiptLine and Discount. Cashier scans item and a receiptline object is added. If the added ReceiptLine object have a Discount Id then, it has to lookup in Discount object and issues discount after validation. I have problem in validation. [code]

View 2 Replies

Linq - Database Advice Needed: Porting VB6/ADO/JET App?

Jul 22, 2010

I need to update (well, rewrite really) a SMALL VB6 application which uses ADO to access a JET database, to a vb.net app in Visual Studio 2008. My research suggests that I should use LINQ, but it doesn't seem to be possible to connect to JET. If JET is now deprecated, what should I use? Or should I use ADO.NET without LINQ?

Please don't answer SQL Server! - this needs to be an app that end users can install easily in corporate or non-corporate environments, and must not require any ongoing technical maintenance. I started to install SQL Express, but stopped when it required at least 2 system updates, as that will be far too complex for this little app.

View 4 Replies

Web Service On Web Server For Local Application Advice?

May 15, 2009

i am looking into web services to be used for a windows forms application that i want to connect to my website and return data from my database. One thing i am concerned about is security. I have only played with web service a little bit but it seems to allow direct access to it by url and then run the service, showing the results in the browser. i guess i could set it up to accept a password in the code. i guess really if i have to pass in the query criteria to the sql from the application then showing the records in a browser should not be a problem. in my web application for the site i can keep all my web services in the app_data folder for no browser access.

i just need some advice in this area. goods, bads, other options if better. i don't have a full grasp on working this way from a client side windows application.

View 9 Replies

VS 2008 : Linq / Sql Advice On Using Dropdown Checklist Usercontrol Values?

Apr 16, 2011

I had actually getting LINQ to work but I am past that now but I was wandering if anyone could help me what I basically have is a DropDownChecklist user control I made and the contents of the list are filled by LINQ getting a list of company names see below:

'Population for company filter box
Public Function GetCompNames()
Using DC As New DataClassDataContext
Dim comp = (From C In DC.Companies _

[code]....

Would you suggest using a public array or something to store the companyID's when populating the first list box? This just came to me at the end of writing this post. Will try this but not sure if its the right thing to do.

View 1 Replies

Randomize Or Shuffle A String?

Oct 21, 2010

Can someone tell me how to shuffle / randomize a stringi got a string like: 0123456789name0123456789and i want it to become a random like: 343n3287a4738m2039e7834

View 5 Replies

Shuffle Array Of Numbers?

May 16, 2012

I am trying to shuffle an array of numbers it is randomizing but the numbers are been repeated is not what I need., I need the array to be shuffled but keeping the same numbers.For example if I do a first shuffle numbers may look like this in random order

2,4,5,1,3

Next shuffle maybe

3,5,4,2,1 and so on

But my problem is it repeating e.g. like this.

0,3,3,4,5 or 4,5,5,3,3

[code].....

View 2 Replies

Shuffle Bingo Numbers?

May 16, 2010

I want to shuffle the numbers in each column of _bingoNums(,)I've included the code I've tried thus far that dosen't work.

Dim _bingoNums(,) As Integer = {{1, 16, 31, 46, 61}, _
{2, 17, 32, 47, 62}, _
{3, 18, 33, 48, 63}, _

[code].....

View 2 Replies

Array And Use Of Flag To Shuffle Numbers?

Apr 10, 2011

i am trying to find out how it shuffles the number 1, 2, 3 and 4 without repeating the same number within the series. So far, I think that "i" begins as 1 and RN is a randomized number between 1 and 4. The do while loop checks if "i" is the same as RN and spits out the flag as true or false. Then "i" is increased 1 at a time and so does the number of elements in the array. I believe that the array a(4) and the for loop does something that "remembers" the same numerical value not to be repeated. I'm not sure exactly what the for loop does and how the flag make this thing work.

Lets say, a case where i=1 and the RN=3, the flag becomes false. Therefore, a(1)=3. Then, i increments by 1 and a(j) becomes a(2), which puts out the values 1 and 2. Since both numbers are flag=false, it increments again. Because a(i) = RN, a(2) becomes = 3. How can this be? It has a(1) equal to 3 and a(2) also equal to 3. Each array is supposed to have NON-OVERLAPPING numbers.

The result of doing shuffle() is a random set of numbers that don't overlap:

1234, 1243, 1342, 1324, 2341, 3412, 4321, 3214, and so on.
but never 1111, 1112, 3333 or 3242.

To find out how exactly it works, I tried to delete some lines, tweak the numbers. The result of that is either numbers change to repeats, all zeros or a logical error. The following is the code placed in the module and can be used for other forms and in this case it is used for the labels in form1 windows form:

Sub Shuffle()
Dim a(4), i, j, RN As Integer
Dim flag As Boolean

[code]....

View 2 Replies

.net Media Player Shuffle And Random Play?

Feb 25, 2011

i created a media player in vb.net. i have a listbox as playlist. My problem is i have picturebox1 in which if i have to click shuffle the items in the playlist (listbox) will shuffle songs. Also, the playlist must automatically play songs.

View 5 Replies

Shuffle 10 Audio Files And Play In A Loop?

Dec 11, 2010

I have 1-10 audio files that were selected by the user using an "openFileDialog" (with a button and textbox for each). Now, I want it to play all of the files that they selected in a random order when the user clicks "Button12." After all the files have been played, I want it to start over and play all of them in a random order again. I don't want it to stop until the user clicks "Button13." When the user clicks "Button 12" again, it should start playing them in a random order again.

View 4 Replies

Write A Method To Shuffle A Deck Of Cards

Nov 13, 2011

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

View 3 Replies

Audio Playback - Make The Shuffle Never Play The Same Song Twice

Mar 21, 2011

Basically my program has a "shuffle" music feature:

vb For i = 0 To 26 num = randomObject.Next(0, 27) My.Computer.Audio.Play("C:UsersMcturtlesMusicSongs" & num & ".wav", AudioPlayMode.BackgroundLoop) Next

Which selects a random number 0 - 26 and selects the corresponding song.

And a straight play feature:

vb Dim counter As Integer Do Until counter > 26 My.Computer.Audio.Play("C:usersmcturtlesmusicsongs" & counter & ".wav", AudioPlayMode.WaitToComplete) counter += 1 Loop

All of these activated by a button(separate for each)

When I click one, it makes the program stop responding. I'm pretty sure it is the .WaitToComplete mode, but I can't find a way to make it continuously play without it. If you can find my error. Also if you could tell me a way to make the shuffle never play the same song twice, that would be awesome as well.

View 2 Replies

Media Continuous Play And Shuffle Into A Checkbox Form

Jul 20, 2009

Not sure if this is the right thread place or not.And I've been designing an Mp3 player. I've ran across several things that I would love to know how to fix.

1. It won't play the next song when one ends.
2. Click and drag media files into the playlist.
3. Shuffle button would be awesome.
4. Repeat button.
5. I have a pause button, but it dont pickup where it paused...

If you could get the repeat playlist and shuffle into a checkbox form.[code...]

View 4 Replies

How To Deal SQL With Apostrophe(')

Aug 17, 2011

I am using VB 2005 and MS Access 2007.Some of business name has apostrophe(') and I need to know how SQL deal with this name.For example

sqlStr = "SELECT * FROM AddressTable WHERE BusinessName=" & "'" & updateBName & "'"
in this case, if updateBName is "Den's Nail", the real SQL is
"SELECT * FROM AddressChangeTable WHERE BusinessName='Den's Nail'"

and this code generates Error Message.Is there any way to prevent error ?Or do I have to remove all apostrophe(') in Business Name?

View 3 Replies

Deal With Attachment Fields Using .NET?

Aug 1, 2010

how to deal with attachment fields using VB.NET?

View 3 Replies

How To Deal With Multiple Records ADO

Feb 28, 2010

I have following data in my table:

slno Name Age City
1 Ron 22 Dallas
2 Jonny 26 Texas

Now i use the following method to access data:

Try
Using connection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=E:Visual Studio 2008ProjectsSmart SyncronixSmart SyncronixSmartDB.mdf;Integrated Security=True;User Instance=True")

[Code]....

View 1 Replies

How To Deal With Tabs In A Tabcontrol

Jul 27, 2011

TabControl1. It is the only control that is created in design time. My text editor is a tabbed program. I have a addtab() function that whenever teh user clicks the toolstrip addtab, the tabcontrol adds tabs. THe code below is for the addtab()

Private Sub AddTab(Optional ByVal file As String = Nothing)
NewRTB.AllowDrop = True
NewTab.AllowDrop = True

[code].....

View 2 Replies

How We Use List To Deal With Attribute

Sep 1, 2010

how i can but the attributes that exist in web page in vb.net list and what are the differences between arraylist and list in vb.net???

View 4 Replies

Clean Up App And Deal With The Async Calls?

Mar 16, 2010

My app is basically talking to a device via RS232. I need to 'listen' to the data received and do certain things based on it, update labels, etc. When I started, I only had a couple cross-thread calls and I used JMC's example to get by that. Now my app is bigger and I am calling the ThreadProcSafe all the time. I am hoping there is an easier way so I don't have to create sub routines for every control. Here's the relevant parts of my code.

Private Sub StepperSerialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles StepperSerialPort.DataReceived
Dim ReceiveBuffer As String

[Code].....

View 4 Replies

Deal With Someone's Ugly Code Gently?

Jul 7, 2010

I've recently been given the task of finishing an incomplete project for my University. It'll count as credit for one Class so I'll shave a month off of my studies!

[Code]...

Methods returning numbers just for the hell of it, passwords being saved in plaintext, you name it.

I have a meeting with the original author and I don't know how to handle this situation because I'm quite green in this area. How can I tactfully mention that I want to rewrite the whole thing?

View 12 Replies

How To Deal With Index Out Of Range Exception

Feb 1, 2011

I was trying to add two quantities at different rows of same description i.e same product_name and same item_pack.1st I want to check the table if it contains the same description or not by comparing with the first record and so on. When found, I'll add up the quantities and then to delete that particular row (to avoid duplicate search). But when I delete the row the particular row, next time it throws an out of index exception

View 2 Replies

Html - How To Deal With Special Characters In .NET

Jul 20, 2011

I've received a text file in which the text is like this, ãYAHOO.COM. When I'm debugging in Visual Studio, the value I see for the character is "�"c. Firstly can anyone tell what is the character before yahoo. Is it a special character or some html character, and what is the character that I'm seeing in VS while debugging.So it goes like this, the ascii value of the character turns out to be 63.But when I write the value to a file it generates 3 characters whose ascii values are above 127.

View 3 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

Using Textbox To Deal With String More Efficiently?

Feb 23, 2009

I've been trying to improve the efficiency of my giant program and I know that using a textbox to deal with a string is terribly inefficient.
Function CollectionSplit(ByVal TheString As String, ByVal TheSeperator As String)
Dim tb As New TextBox
tb.Text = TheString.Replace(TheSeperator, Environment.NewLine)
Dim returnable As New Collection
For Each x As String In tb.Lines
If Not x.Length = 0 Then returnable.Add(x)
Next
Return returnable
End Function
What it does is convert a string of "1,2,3" into a collection of the 3 separate items for use later on.

View 1 Replies

VS 2008 Best Way To Deal With Pre-defined Logins

Aug 28, 2009

[code]...

I got an Error about the INSERT INTO statement at command.executenonquery, but Im not seeing it. Could it be something else?

View 5 Replies

.net - Deal With Output From A Secondary Process In Realtime?

Apr 27, 2012

I am trying to write a VB .NET program that runs a Perl script and reads and uses the standard output. I'd like to be able to handle each line separately as it is printed, and update my program display accordingly. Here's some code I have "written" (read: "mostly copied off the internet"):

Private WithEvents pscript As Process
Private Sub myProgram_Load(sender As Object, e As System.EventArgs) Handles Me.Load
pscript = New Process()

[Code]....

This works with one problem: the program waits until the test script has run to completion, and then fires several OutputDataReceived events one after the other. This means that when I make it use the real script, it's likely to do nothing for as much as several hours, and then have to deal with, like, 5,000 events at once, despite the fact that stuff was being printed at fairly regular intervals throughout that time.

Is there any way I can make it deal with each line of text when it is written, instead of all of it at once at the end?

View 2 Replies

Cleanly Deal With Different Behavior Based On Polymorphism?

Mar 24, 2011

Suppose I have an interface IFoo with implementation classes VideoFoo, AudioFoo, and TextFoo. Suppose further that I cannot modify any of that code. Suppose that I would then like to write a function that acts differently based on the runtime type of IFoo, such as

[Code]...

Then I have to do my "If TypeOf ... Is" again. How can I refactor this to take advantage of the polymorphism of the implementations of IFoo without manually checking the types? (in VB.NET, though my question applies to C# too)

View 3 Replies

Deal With Adobe InDesign Files In .Net 2008?

Apr 6, 2010

How to deal with Adobe InDesign files in VB.Net 2008 such as searching for text or insert a picture?

View 1 Replies







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