VS 2008 Evaluating Multiple Possibilities?

Apr 16, 2010

I am making a checkers program and I am in the phase of starting to evaluate jumps. This is what I currently have so far and allow me to fill you in a bit before you look at the code. Checker pieces are white/green. Each checker is created as a label at runtime and in the tag property a struct is held that possesses all of the information reguarding current and previous checker state.

The problem I am having is that as this sub runs each opposing checker is evaluated for jump capabilites which is all fine and dandy. It is even alright that currently if a jump is executed that the same side will continue to evaluate through the sub looking for additional jumps and if they are found they will be made because that is how it is currently coded. What I am trying to do is find a way to evaluate each piece that can jump. So if checker1 can only make one jump and checker2 can make a triple jump checker2 needs to be the guy making the jump and I honestly don't know how do start that. I am forseeing global vars being created to hold information or even a structure and taking the one that changes the most. If two checkers can only make 1 jump then I will rand the one that gets to jump (not looking to win any awards for AI here). Anyhow, any suggestions on how to start this, at least saving the information throughout the sub even if it is called recursively?

[Code]...

View 4 Replies


ADVERTISEMENT

C# - LINQ Select Distinct While Evaluating Multiple Rows

Jul 11, 2011

I have an EnumerableRowCollection that looks like the following:
VendorCode | GroupType | Variance
01165 G .16
01165 G .16
01165 CH .16
01165 CH .18
07754 G .25
07754 G .25
07754 G .39

Essentially, this is a massive list of vendor codes, their groups, and price variances. I need to compose a query that will create a distinct list vendor codes and group types. The catch, however, is that I need to evaluate all of the variances associated with that particular VendorCode/GroupType to see if they are all the same - it they are not, I need to return some way of signifying that the group has a "custom" variance, otherwise it needs to return the value (ie: if they are all .16, then return .16, if there are multiple values, return "custom")

The result would look like this, based off of the list I showed above.
VendorCode | GroupType | Variance
01165 G .16
01165 CH custom
07754 G custom

I have no trouble getting a distinct list of VendorCode/GroupType - this is what I have so far:
Dim distinctList = From q In query Select q.VendorCode, q.GroupType, (evaluated q.Variance here?) Distinct
(where "query" is an EnumerableRowCollection(Of (anonymous type)))
I'm at a loss, though, on how to evaluate the variance property to get the result that I need?

View 1 Replies

[2008] Bind The Combobox To It's Record But Also Display All The Possibilities?

Jan 17, 2009

this code

Me.vendorLookup.DataSource = vendorBAL_C.vendorTable
Me.vendorLookup.DisplayMember = "SimpleId"
Me.vendorLookup.ValueMember = "VendorId"
Makes the combobox have a list of Names (simpleid) and PK (vendorid)

How do you make the combobox also be bound to a specific row of a record in an "case management" table? I've already used the datasource for a table of vendors - right?Or is this where I put two tables into a DATASET and make that be the DATASOURCE?

View 1 Replies

VS 2008 : Evaluating A Poker Hand?

Apr 8, 2009

We are working on a poker game as a class project. My part is to evaluate and then determine the value of a players hand. We are evaluating from highest to lowest (ie. determining whether the player has a straight flush, 4 of a kind, full house, flush and then going all the way down to a high card only "worthless hand"). My part is evaluating the 2 pair, 1 pair, and nothing hands. The hand will be a two-dimensional array with the row(0 thru 12),column (0) containing the numeric "face" value of the cards and the column(1) containing the value assigned to the suite (1=clubs, 2=diamonds,3=hearts,4=spades). I have NO IDEA where to even begin this evaluating procedure.

View 4 Replies

Get The Entire Group Of Possibilities To Show?

May 25, 2009

i have a group of pictureboxes, each with their own id names. the names are in integer form, 8 letters long, to represent thier inner values. The number of possibilities are 12.Each uses 8 of the 12 digits. ( Yes, this is about music scales.) if 3 notes played are put into a textbox, there are multiple possibilities of which scale it could be. My goal is to get the entire group of possibilities to show, without having to code each one out seperately. Each scale is set in its own picturebox. Notes played, or questioned are placed in textbox1. the notes A,C,D, for instance, would show CMaj scale, FMaj scale, GMaj scale, ect. how would I produce all these off one textbox?

View 2 Replies

Code Generation Possibilities In Visual Studio 2010?

Dec 29, 2010

Just started a new project and was kind of bummed out that instead of creating interface Im forced to spend quite large amount of time creating objects, INSERTs,UPDATEs.. that kind of thing. Mainly because it's booring. Anyway, I was wondering if there are tools in VS2010 for visual basic that would allow someone to generate clases and INSERT, UPDATE, DELETE stored procedures based on database structure OR creat INSERT, UPDATE, DELETE procedures and database structure based on class structure.

View 2 Replies

If / Then Not Evaluating?

Dec 2, 2011

So I am trying to evaluate 3 conditions in an if statement. Its not working how I would assume it should. I basically want to do this:vb.net If PGN = &HEF007E And PGNData(0) = &H58 And (PGNData(1) And &H40) = &H40 Then IgnOn = True Else IgnOn = False If I write it in that manner it gives inconsistent results. If I workaround by writing it this way it works perfectly:vb.net If PGN = &HEF007E And PGNData(0) = &H58 Then If (PGNData(1) And &H40) = &H40 Then IgnOn = True Else IgnOn = False

View 1 Replies

Evaluating A String Expression?

Feb 17, 2010

Does anybody know of a call in vb.net that will evaluate a string expression. For example, how would one evaluate the expression "(1+2)*(3+4)"?I've looked all over and it seems that people are writing their own parsers. There has to be a better way. After all these years, VB.Net must have something that will take an expression and evaluate it.

Dim strMyExpression as string = "(1+2)*(3+4)"
msgbox( VBEvaluate(strMyExpression))

and the result would be 35.Also, when will microsoft start to use google as the search engine for these forums? Bing really sucks. Searching for "Evaluating a string expression in VB.net" gives the most bizarre links.

View 7 Replies

Evaluating A DGV Row And Change Row Bavkground Color

Aug 26, 2011

My DGV's last visible column in a boolean. I am needing to go through each row and determine if the value of dgv item bFlag is true then turn the row back ground red. Here is my start of it. It appears to be only making one loop then giving the message box.

Private Sub EvalGrid()
BindDGV(dgvResults)
Dim cnt As Integer = dgvResults.Rows.Count

[Code]....

View 9 Replies

Evaluating A String As A Line Of Vb Code?

Nov 18, 2010

I am trying to figure out a way to set a string equal to vb code and then run that string as a line a of vb code.

for example
set string x = "TextBox1.Text =
"test1".ToString"

[code]....

View 4 Replies

Evaluating A String Expression At Runtime?

Aug 27, 2009

I have a application that allows the user to enter a series of nested filtering commands. E.g "Name starts with x or ((Description contains y or Property1 is On) and Property2 > 100)"

I can preprocess this and distill it down to a string in the form of an expression of True and False's ie, To "True or ((False or True) and False)" Is there a simple way to have this final expression evaluated without having to write a complex evaluator myself?

I have seen a method of evaluating this by compiling a dummy function at runtime but as I need to process this against possibly thousands of records that solution is too slow.

BTW These are not all fields in a database so I cannot use Queries or SQL etc.

View 2 Replies

Evaluating An Algebraic Equation And Getting The Answer?

Jun 19, 2009

I store a formula in the database such as the following:GrossIncome+(Overtime/0.5)-Deductions=BasicNetIncome

I am able to substitute the string representations with actually values entered, thus:1000+(150*0.5)-100=BasicNetIncome

Then I remove the '=BasicNetIncome', thus:
1000+(150*0.5)-100

How can evaluate the above equation to return a result:

[Code]...

View 1 Replies

Evaluating Dynamic String Formulas In .NET?

Dec 5, 2010

I'm working on a project where I need to evaluate some formulas in VB.NET. I've been using the MS Script Control to evaluate some of the simple logical/mathematical formulasHowever, I'm now faced with dealing with string expressions that set variables in my program to certain values. So, for example, let's say I've got the following:

Dim netPrice As Decimal
Dim expressionFormula As String = "netPrice = 0"

[code]....

View 3 Replies

Evaluating Mathematical Expression In A String?

Jul 7, 2011

Is there a method that allows me to evaluate a mathematical expression in a string? Example (Not actual Code):

Input = "2+2"
Output = SomeMethod(Input)
Output = 4

Update: Nevermind, I found a way around it by using DataTable.Compute.

View 1 Replies

Evaluating Modal Dialog Result?

Apr 4, 2011

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
With Me.PrintForm1

[Code]....

View 6 Replies

NVelocity Macro Parameter Not Evaluating

Jun 14, 2011

I'm looking to create an inline function (method) inside my NVelocity template. The solution to this appears to be to use Velocimacros. So, I mocked up the following template to test:

#macro( getOutput $one $two $three )
<td>$one</td>
<td>$two.Item2</td>
<td>$three</td>
#end
[Code] .....

When I run the template, the problem I'm having is that the output from the macro parameter $three is literally "$item.Item3" instead of evaluating to #3/3/2003#. (BTW - this happens with any of the 3 items in the tuple if they are passed with the .Item call, so it isn't about the data type). I can make a variable and pass it just fine ($one1). I can pass the tuple itself and call the .Item property inside the macro ($item.Item2), but for some reason I cannot call the .Item property when passing the argument to the macro.

View 1 Replies

.net - IsNumeric Throw FormatException While Evaluating An Object?

Apr 5, 2012

I'm working with visual studio 2008 developing software for windows CE 6.0, compact framework.I'm having this "strange?" trouble with isNumeric method. Is there another better way to do this job? Why is getting me an exception? (two in facts...both of type FormatException)

dim tmpStr as object = "Hello"
if isNumeric(tmpStr) then // EXCEPTIONs on this line
// It's a number
else
// it's a string
end if

View 2 Replies

C# - DebuggerDisplayAttribute - How Does It Choose The Language When Evaluating Expressions

Sep 22, 2009

[URL]From what we can see on MSDN, it says to be careful about which expressions we put as they change from language to language. My question is: what are the supported languages for writing those expressions? If various languages can do it, how does it detect which language is being used?I've made my class in CLI, and coded the expression in c#, being that it works. I've tried in c++/CLI, but that way it doesn't.

Here is my code:

[DebuggerDisplay("z = {ToString()} Norm = {System.Math.Round(Norm,2)} Angle = {System.Math.Round(Angle, 2)}")]

Now, trying it the c++/CLI way:

[DebuggerDisplay("z = {ToString()} Norm = {System::Math::Round(Norm,2)} Angle = {System::Math::Round(Angle, 2)}")]

My assumption is that it will always read the expression as c# code. Is this true?

View 2 Replies

IDE :: Visual Studio 2010 Enviroment Is Not Evaluating Expressions?

Nov 19, 2010

Just switched over from VS2005 to VS2010 and I am having issues debugging my software. When I stop at a breakpoint, I can't see what variables contain. When I try to look at variables with QuickWatch, it states that it is "Unable to evaluate expression."

View 3 Replies

VS 2008 Return Multiple Table Rows To Multiple Text Boxes

Feb 27, 2011

visual basic 2008 express
access 2007 db

I am attempting to fill a form with multiple rows from an access table based off of a parameterized query. My query works fine but I don't want to return one row at a time, I want to return all rows that match my query in multiple text boxes. I know that I can use a datagrid view to accomplish this, but I would prefer the look of a textboxes on a form. I have read through many books and searched the internet forums but think I may just not know what to search for as nothing has worked yet. Can anyone point me in the right direction. So far I have tried setting the text box value to the row().item(), creating a different dataset for each row, and even setting variables for the results of the query to then be passed to the text boxes. Since none of this work, I don't really have any starting code to post. If I could just get a starting point I could work from there, so don't feel the need to code anything for me, just set me in the right direction.

View 3 Replies

Repeat Cards Showing Up In Game And Win Evaluating Code For Poker Game?

Jul 2, 2009

I am working on a poker game and I have the game setup the way I want it in terms of graphics and I have the code programed to deal the cards out exactly how I want them. Granted, the code is very simplistic, but functional for a new programmer like myself. I'm sure there are other more efficient ways to code my game, but I like mine so far because I can at least understand the majority of it. With that being said, here are a few problems and questions that I have.

1. How come when all 12 cards are dealt out I have some cards repeating in the game? For example, I get queen of diamonds in more than one picture box when I only want the card to be dealt once and then removed until the next game.

2. I was hoping to have a button 3 to clear all the boxes, basically resetting the game to the next game. When I hit button 3 it only clears the contents of picturebox 10 and 12.Other notes: I have the deal down the way I want it. It deals the first 10 picture boxes and a second button deals the 11 and 12 picture boxes.

3. I know this is my next step so I want to post it with the code I currently have. I want to start taking my project one step further by evalutating each of the three rows of cards (3 rows of 3 cards each - I'm not worried about the dealers hand (picture box 10, 11, 12 yet). So I want to evaluate a row of pictureboxes against a "pay scale" and display the win in a text box or label next to the 3 card hand. For example, Q of diamonds, Q of Clubs, Q of spades would win 15, etc. ( have a weird feeling I may have to change the names of the cards (I have them named card1, card2, etc. right now) to something that identifies them in order to evaluate the hands.

Here is the code that I currently have. I'm using visual basic.

Public Class Form1
Dim Rndm As New Random
Dim myPB(11) As PictureBox
Dim HiddenCards As New List(Of String)

[code]....

View 1 Replies

Multiple Do Until Statements In VB 2008?

Mar 2, 2010

I need to write a do until statement. 2 of them actually. 1st one records all of the income and then one that records all of the expense. Then they need to be add to figure a profit or a loss.

View 12 Replies

VS 2008 - Multiple Threads - Get Two Value?

Jul 28, 2010

I'm testing here something, but i don't know what's the best way to do this.I have a var that tells the application the number of threads that will be started, inside the thread/function that i call i need to return/get two values i have two sub functions, each one returns an integer.Then in the end i need to sum the values.

Example:
Thread1/Function
SF1 - Returns 2
SF2 - Returns 3

Thread2/Function
SF1 - Returns 1
SF2 - Returns 5

After all threads are over, i get the
SF1Total = 2 + 1 and
SF2Total = 3 + 5.

I'm thinking in using shared vars, and inside the function/subfunctions update the values. It's this a correct way to do it? Other question, the threads are assync, but i need to know when the last one finishes. How do i control this? The order they finish doesn't need to be the order they were called....

View 4 Replies

VS 2008 Multiple Checkboxes?

Feb 23, 2012

Here's the scenario.I have 7 checkboxes.Checkbox1 is equal to "All" where it checks all remaining checkboxes when it is checked.And the remaining 6 Checkbox2 to Checkbox7 has certain conditions if they are checked.Is there a easiest way to do this? Like using a If Elseif Statement?

View 12 Replies

VS 2008 Multiple Keystrokes?

Dec 30, 2010

Does someone knows how to read multiple arrow keystrokes at the same time.Like when I have up + left so it should do something like diagonal up-left?

View 1 Replies

VS 2008 X86, X64, PID, Multiple Instances?

Feb 6, 2010

My ultimate goal is to get a list of PIDs and have a user select 1 of them.For example: the process image name is program.exe. The application name varies for each instance the program.exe is run, and therefor each application name has its own PID associated with it. By application name I mean the Task name under the Applications tab of Windows Task Manager. Another issue I face is that some systems run x64, so the name is no longer program.exe but program.exe*32

So my issue is, how do I search for program.exe, or on x64 platforms program.exe*32, and if there are multiple instances of program.exe/program.exe*32 running, how can I get a list of PIDs for each and associated them with the application name as the Task name under the Applications tab of Windows Task Manager.that might sound a bit confusing! So if it is, please let me know and I will try to explain more. Any reference guides or example code would be greatly appriciated as I have only used the "System.Diagnostics" but once.

View 2 Replies

[2008] Ping Multiple IP's

Sep 14, 2008

Ok so for a while now ive had a program that pings about 15 computers on my network, but the way i have it is pretty messy, id like to somehow make the code a bit cleaner. so what i have is something like this

[Code]...

View 39 Replies

Print Multiple Pages In VB 2008?

Jul 31, 2010

I am new to programming and I need some help. How do I print multiple pages? What am I doing wrong?

Private
Sub PrintDocument1_PrintPage(ByVal sender
As System.Object, ByVal e
As System.Drawing.Printing.PrintPageEventArgs)
Handles PrintDocument1.PrintPage

[Code]...

View 8 Replies

VS 2008 Compute With Multiple Filters?

Jun 12, 2011

Is there a way to use the DataTable.Compute Method with 2 or more filters, i have googled a bit and cant seem to come up with answer?

Current code
Dim Dt As Decimal = NumericUpDown1.Value
dtlist.Rows(i)("Value") = dtsold.Compute("Max(ClosePrice)", "Distance <=" & Dt & "")

[code].....

View 4 Replies

VS 2008 - Choosing Between Multiple Comboboxes?

Nov 17, 2010

I have a program issue I am trying to work on. I have multiple comboboxes(12 total) on a form.I am attempting to update some settings from what ever the user selects from the combo boxes. I am trying to keep the code as small as possible, so I thought about having all the comboboxes have similar names only different by a number being changed at the end. (ex: cbo_1, cbo_2, cbo_3, etc...)And using a For next loop to advance through each combobox and update the settings as the for next loop advances.(This might be a stupid way of doing it, but its the first idea that came to mind.)

[code]...

View 1 Replies







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