Minmax Algorithm Only Winning When The Move Is In Direct Sight - Otherwise Always Allowing The Player To Win

Feb 7, 2012

I've been pulling my hair for three days trying to figure out what has gone wrong in what little code I have in my first attempt at both the minimax algorithm, and recursive calls in general (I'm relatively new to programming). Basically, I have everything working in the application except for the thing I wanted to actually learn and work on in it: The minimax algorithm. Basically, whenever a player makes a move, the computer will do one of two things:

If there is a winning move right next to it, it will use that move. Easy as pie.
However, if this move isn't in direct sight, it will pick whatever move lets the player win. The exact opposite of what it should be doing. I know it's not coming from:

[Code]....

View 2 Replies


ADVERTISEMENT

Make Two Player Game That Allows You To Move Both Player Objects With The Same Event?

Jan 19, 2012

So I am trying to make a program that allows you to move two shapes using two KeyPress events, one to move the first object and another for the second. It works, but it can only move one of the two objects, not both at the same time.

Private
Sub
Form_KeyPress1(ByVal[code]......

View 9 Replies

Simple Multimedia Player Algorithm?

Aug 6, 2011

I've just recently started using VB.Net 2010 Express edition and Windows 7 Home Premium x64 and I'm trying to write a simple multimedia player. My algorithm is: Simple mutlimedia player algorithm: 1. Create a form with three listboxes (one for accessible directories, one for accessible files, one for INACCESSIBLE directories and files), a drive combobox (for a list of drives). A textbox for holding the file extension. A 'start search' button to initiate a search for the files. 2. Form load populates the comboBox with a list of all logical drives that are of type fixed and are ready. 3. The user selects a drive to search using the comboxBox. 4. The user enters a file extension in a textbox. 5. The user presses the search button. 6. The computer searches all directories starting at root for any and all files matching the file extension. The allowed read access directories are added to a listbox of directories. The allowed read access filenames (i.e. the full path of each individual file) are added to a listbox of filenames. 7. Once the files listbox is populated, clicking on a file in the listbox passes the full path of the selected file to another form which is opened and shows the ID3 v1 tags of the file in textboxes and also the obligatory open, play, pause, stop and close buttons. Plus an Edit Ok button which gets enabled if the user edits the ID3 v1 tags. 8. The sequence for playing the file is: open, play (then any of pause, play, stop), close - note that close also stops the file first if it is currently playing then closes it. 9. The user closes the playing form and goes back to first form (i.e. the search form). 10. Closing the search form exits the application. Ok I can populate the drives combobox no problem. I can get a list of directories ok I can't (and believe me. I've tried 100's of ways) seem to get a filelist of all the files in all the directories [starting at root] that match the criteria - that's the bit I keep getting stuck on. I keep getting an unauthorized access exception. Trapping that exception doesn't seem to do anything useful as I can't continue the search loop (OR get the filename that is causing the exception and add it to the files listbbox) - and so can't get any filenames. BTW I can open, play, pause, stop and close any given mp3 file (with a correct path) no problem using the Win32 API.

I know I've d/l a couple of file listers but they are/seem highly complicated for what should be a very simple task. In good old DOS, it would take a line or two of using the DIR or Tree commands to find the files so I can't believe that it is so hard to do in VB.Net It seems [to me] that Directory.GetFiles(searchpattern, startdirectory, option searchFolderDepth) doesn't properly work due to the exception which arises from the unathourised exception event (and which it then seems to be impossible of getting the filepath and then continuing the loop by simple exception handler code).

View 1 Replies

Allowing Two Windows From The Same APP To Move?

Aug 19, 2011

I'm making a VB.net application. I have a dialog that pops up at some points. It is set as TopMost. The problem is, when it pops up, you can't move the main form. How can I make it so it shows and is usable while allowing the main form to continue to be usable?

View 1 Replies

Music Player - How To Move Trackbar Button

Jan 31, 2010

I making an music player with a trackbar who gets oppdated while the music is playing. My problem is that I have to move a the trackbar button.

This is my code:
Dim TotalSeconds As Long = CLng(Form1.Player.TotalTime) ' 274445
Dim CurrentSecond As Long = Form1.Player.CurrentTime ' 10497
' maxp is the maximum x location on my bar
Dim nyp As ULong = CULng(((TotalSeconds / maxp) - CurrentSecond))
TB.Location = New Point(CInt(nyp), 11)
Why is it return INF?

View 2 Replies

Set The Computer Player To Move According To The Ball's Position?

Nov 22, 2010

I'm coding the game timer, but am noticing that the gameBall is undeclared and don't see it in the tutorial.Private Sub gameTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gameTimer.Tick

[Code]...

View 5 Replies

Make A 2 Player Game But Both Players Can't Move At Once Unless They Tap The Keys?

Aug 20, 2009

Well I am trying to make a 2 player game but both players can't move at once unless they tap the keys (can't hold the key down or the other person can't move). How would I fix this as well as being able to go diagonally.Would this work?:Declare a bool value for each keypress below the public class thingy. Then use keyup to turn the bool off and keydown makes it go on. Then for the first player and second player I check if they are on and if they are than go to that direction...I think I would need a timer for that part but I dunno...

View 3 Replies

C# - Is It From A Sight Of Resources Reasonable To Use A StringBuilder Already To Concat Two Strings

Jul 9, 2010

Is it from a sight of resources reasonable to use a StringBuilder already to concat two strings or is there a minimum concatenation operations that makes the StringBuilder efficient?

View 4 Replies

C# Is Always Winning Over Program

Apr 2, 2009

I wrote a program that allow two classes to "fight". For whatever reason C# always wins. What's wrong with VB.NET ?[code]...

View 4 Replies

Implement An Algorithm Called "Diamond-Square Algorithm"?

Jun 8, 2009

I am trying to implement an Algorithm called "Diamond-Square Algorithm" I am having trouble ending it so that it retiurns the required result. So far I have the folloiwng.

[Code]...

View 3 Replies

Sequential Files - Displaying Winning Percentage Of Teams?

Jun 11, 2011

Suppose a sequential file contains the information shown below. I need to write a program to use the file and produce a new list where the teams are in descending order by the percentage of games won, and also displaying the winning percentage
Team Won Lost
Baltimore 69 93
Boston 96 66
New York 94 68
Tampa Bay 66 96
Toronto 83 79

View 2 Replies

Slot Machine In Winning System Not Properly Working

Jun 23, 2012

I am coding myself a Visual Basic.Net 2005 Slot Machine program. I've been hard at work on this for about a week and half now. From what I have with it it works and all. However there are so many annoying errors with the program.

LIST: - I am not winning when I should be. My winning conditions is set when you get 3 of the same picture you are to be awarded with some credits. It works but sometimes when it does land on 3 of the same pictures it still says that I've lost. This is the main problem and I am about to pull my hair out about this - The image with the lowest value is showing up the least and the picture with the most value is showing up more frequent? I don't want to change them around to fix that.

[Code]...

View 6 Replies

VS 2008 - How To Generate Tennis Percentages For Winning Team

Mar 8, 2012

The application I want to make is what I would call quite simple, you will have two text boxes where you enter in two team names.
i.e.
Team 1 v Team 2
Then below a little search button. And then when you click the button it will show a percentage of whom is most likely to win. Now I know that I would have to most likely enter something like
Team 1 v Team 2 WIN Team 1
Team 1 v Team 3 LOSS Team 1
Team 1 v Team 4 WIN Team 1
In some kind of script for this to work so when you search for
TEAM 1 v Team 2 it will show WIN Team 1

View 2 Replies

Made A Media Player But When Click Open With It Opens The Player But Doesn't Load The Film

Jun 28, 2011

Public Class EasyPlayer
Private Sub EasyPlayer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
System.Diagnostics.Process.Start("MediaPlayer")
End Sub

[code]....

View 1 Replies

Indows Media Player Doesn't Play The FLV Player?

Apr 10, 2009

I want to know that how to add FLV payer component in VB.Net..cz windows Media Player doesn't play the FLV player.

View 2 Replies

Lotto Programming - Have Some Input In App To Possibly Entering Previous Lotto Winning Combinations?

Nov 15, 2011

This idea of mine is basically more of an experiment ive wanted to play around with so here are some features im after.Firstly some of the conditions i would like to have are to give me total amount of combinations possible for a 1-45 number game. I would like to have some input in this app in regards to possibly entering previous lotto winning combinations and the app to remember what i've previously entered and to eliminate them from total overall combinations left as well update odds at the same time.another condition i would like would be to be able to retrieve a list of all combinations of a required sum i.e a required sum being all 6 numbers added up together, also to be able to remember odds and combinations left To be able to eliminate all even or all odd combinations or even say 5 even or 5 odd combinations basically a filter with these sorts of conditions and of course to update odds and combinations left meanwhile retaining all other possible, or id like to possibly be able to apply filter after filter where i feel the need too i also have a few more conditions id like to have though see what happens if some people can help me out or not guess i might discuss the other conditions id like.

View 5 Replies

Playing Mp3, Without Seeing Media Player And Closing Player?

Aug 13, 2009

i am using following code to play a mp3 with build action for mp3 after adding to application is set to copy always...

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

[code].....

View 4 Replies

Game Programming :: Speed (Card Game) One AI Player And A Human Player

Nov 23, 2010

I'm making a speed card game [URL] for the final in one of my programming classes. I'm looking for a little assistance with how to go about getting it done the best way. I've included the code I have so far below. How does it look? What would you do differently? Would you do anything the way I did? I need to have one AI player and a human player.

Code:

View 3 Replies

Make VB 2010 Media Player Using Picturebox Not Windows Media Player?

Jun 9, 2011

make media player in vb6 or vb2010.. not using windows media player..

View 1 Replies

Move - Xcopy Equivlent - Copy And Move The Entire Contents Of A Directory To Another

Jan 6, 2012

how do i copy and move the entier contents of a directory to another ussing VB.net then also delete the files from there original directory?

View 1 Replies

Listboxes In Array: Move To Next Item, And Move To Next Listbox Command?

Dec 26, 2009

I have three listboxes in an array and on form_load the listboxes initially select the fifth item in each listbox:

Private Sub frmSample_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i As Integer = 1 To 3

View 8 Replies

Direct To The Right Forum

Oct 18, 2009

I am developing a web site in Visual Basic 2008 using .NET Frameworks 3.5 on an IIS7.0 web server and I am having a problem with a simple error page redirect. Furthermore I only have ftp access to the webserver in a web hosting environment. I am having problems with some errors and not others, mainly error 401 is the problem.<customErrors defaultRedirect="~/Default.aspx" mode="On" > </customErrors> this is the custom errors section of my [URL] file,

View 1 Replies

How To Use Direct Music In W7

Aug 26, 2011

I've d/l the DXSDK Jun10 version twice now and run the installation but I still can't find any reference to Direct Music (or even directx) in add reference. So how do you use direct music in VB.Net and W7?

View 6 Replies

Direct Help From MS Support On Line?

Nov 24, 2010

How do I direct help from MS support on line?

View 1 Replies

Draw A Direct 3D Line In VB?

Sep 14, 2009

How would I draw a Direct 3D Line in VB?

View 1 Replies

Get Only Direct Descendants Of An XElement?

Aug 4, 2009

[code]...

In this case, children includes all the Parent elements and all of the Child elements. What's the best way to grab only the direct descendants of <Root>?

Should I write a LINQ query that selects elements where parent = <Root>? Or is there some built-in method I'm missing that can get this for me?

EDIT: I had some confusion between XElement.Elements and XElement.Descendants. As Ruben Bartelink pointed out, XElement.Elements will give me exactly what I was looking for.

View 4 Replies

How To Get Direct Link From RapidShare

Feb 16, 2010

I have an account in rapidshare. How can I get direct link from rapidshare link in vb.net?
Sample : [URL]
Direct link is : [URL]

View 2 Replies

Need Direct 3d To Be Able To Install Auto-cad

Nov 20, 2009

I have a new mac with a windows partition. Have been using for a few weeks and all is well on both partitions. I m now trying to install Cad on the windows side, but it says i need direct3d. I have no idea how to install or what i need to install it.

View 4 Replies

UI-Editor For My Custom Direct-x UI?

Oct 9, 2009

I have developed a custom DirectX UI library equipped with everything from buttons to a gridview. I need a screen-layout editor of some sort. It just takes too long to do it by hand, whether through a config file or hard-coding. I could spend a month or two developing a DirectX editing utility, but I don't have a month or two to spend on this. I could possibly justify a week.

Some requirements:

I need to be able to create a new screen I need to place controls such as buttons, textboxes, and containers/windows/etc throughout the screen I need to adjust properties of these controls (Name, Text, Width, Height, Parent Container, etc)

Some of my ideas include:Using VB.NET's form editor... setting up forms and translating the form's control information into game screens.Setting up a web-based editor (seems like this would take more than week... wouldn't it have to be flash based?)Setup a VB.NET win32 editor that allows placement of .NET buttons, containers, etc that correspond to my library's buttons, containers, etc.Is there a best way to handle this?

View 2 Replies

VS 2005 How To Direct To Another Page

Apr 15, 2009

here's my problem.. i'm using a gridview control, and then i put a select column on the grid. My questions are, how to retrieve the data on one of the field in the gridview and then it will direct me to the another page.. (see example below)

[Code]...

once i click the "select" on the gridview, I will direct to another page(ex, Default.aspx) and then at the same time the value on "LastName" field of the corresponding row which i selected will display on the another page(ex, Default.aspx)

View 3 Replies







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