Looking for a simple example of the Minimax algorithm in java

Hey everyone,
I'm currently working on a Gameboy emulator program as a pet project, and for one of the game's I'd like for the enemy AI to use the Minimax algorithm, but I don't have any experience with it (or recursion in general, for that matter). Could anyone maybe post a simple example of how this algorithm works?

WTF? I'm sure you can find plenty of examples on google. It's on you to take the time to go through them, study them, and, if you still don't understand something, post a clear, concrete question that indicates what you read and what you didn't understand about it.
As is, you're essentially treating folks here as your research flunkies and saying, "Give me an example that's better than all the ones already easily available to me. Read my mind to know why I didn't like them."

Similar Messages

  • Looking for a simple example of how to query all the accounts

    I'm new to the web service model in oracle crm and have been trying to just get a list of the accounts in the system. I generated a .cs class from the account wsdl and added it to my asp.net project. I'm able to get a handle on the account class but not sure the right syntax to make a call out.. As a fyi - i also have been able to login thru the service and obtain a session id.. so I'm that far..
    Are they any existing code examples on how to query this? This is what I have so far but i throws an exception -
    Account act = new Account();
    act.Url = "https://"+dbcon.serverName+"/Services/Integration;jsessionid="+ sID;
    AccountWS_AccountQueryPage_Input qbe = new AccountWS_AccountQueryPage_Input();
    AccountWS_AccountQueryPage_Output qRet;
    qbe.ListOfAccount = new Account1[1];
    qbe.ListOfAccount[0] = new Account1();
    qbe.PageSize = "20";
    qbe.StartRowNum = "0";
    qbe.ListOfAccount[0].AccountId = "";
    qbe.ListOfAccount[0].Description = "";
    //act.CookieContainer = .... is this line needed?
    qRet = act.AccountQueryPage(qbe);
    return qRet.ToString();
    Thanks in advance for your help - Todd
    Edited by: user11139473 on May 6, 2009 6:33 PM

    Hi,
    I am doing the same thing but I am not sure what is Account1 in your case. Can you show me the implementation of Account1 class?
    Account act = new Account();
    act.Url = "https://"dbcon.serverName"/Services/Integration;jsessionid="+ sID;
    AccountWS_AccountQueryPage_Input qbe = new AccountWS_AccountQueryPage_Input();
    AccountWS_AccountQueryPage_Output qRet;
    qbe.ListOfAccount = new Account1[1]; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< qbe.ListOfAccount = new ListOfAccountQuery();
    qbe.ListOfAccount[0] = new Account1(); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    qbe.PageSize = "20";
    qbe.StartRowNum = "0";
    qbe.ListOfAccount[0].AccountId = ""; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    qbe.ListOfAccount[0].Description = ""; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    //act.CookieContainer = .... is this line needed?
    qRet = act.AccountQueryPage(qbe);
    return qRet.ToString();
    On the right is my line of code. The ListOfAccount member of AccountQueryPage_Input has datatype ListOfAccountQuery. In my case, a NULL is returned after the call.
    Did you code work in the end?
    Thanks

  • I need for a simple example of  reading a xml file using jdom

    Hello
    I have been looking for a simple example that uses Jdom to read am xml file and use the information for anything( ), and I just can't find one.since I'm just beggining to understand how things work, I need a good example.thanks
    here is just a simple cod for example:
    <xmlMy>
         <table>
              <item name="first" value="123" createdDate="1/1/90"/>
              <item name="second" value="456" createdDate="1/4/96"/>
         </table>
         <server>
              <property name="port" value="12345"/>
              <property name="maxClients" value="3"/>
         </server>
    </xmlMy>Dave

    Hi,
            FileInputStream fileInputStream = null;
            try {
                fileInputStream = new FileInputStream("my_xml_file.xml");
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } finally{
                if (fileInputStream == null) return;
            SAXBuilder saxBuilder = new SAXBuilder();
            saxBuilder.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
                    return new InputSource(new StringReader(""));
            Document document = null;
            try {
                document = saxBuilder.build(fileInputStream);
            } catch (JDOMException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (document == null) return;
            Element element = document.getRootElement();
            System.out.println(element.getName());
            System.out.println(element.getChild("table").getName());

  • Looking for a simple answer ........ without the ...

    looking for a simple answer  ........why is it more difficult for skype to connect than before . It fails to ring most times and your never sure if it is just slow or did not dial in the first place???  and is there any way to disable the leave a message feature ??? I am afraid soon it will be like most wondows applications where you will need endless updates and patches just to keep it running ..... Why is it that everyone is trying to fix everthing when it isnt broken.

    WTF? I'm sure you can find plenty of examples on google. It's on you to take the time to go through them, study them, and, if you still don't understand something, post a clear, concrete question that indicates what you read and what you didn't understand about it.
    As is, you're essentially treating folks here as your research flunkies and saying, "Give me an example that's better than all the ones already easily available to me. Read my mind to know why I didn't like them."

  • I'm looking for a simple DJ app

    Hi Folks,
    I hope this is the best place for this question!  I'm looking for a simple App that will allow me to add music on the fly to a playing playlist. iTunes DJ does most of what I want but doesn't allow me to drag and drop order or remove songs.  I don't need turntables or eq or anything like that.  Just a simple way to create playlists on the fly with the ability ro rearange the order, add and remove songs on the fly. Also, if there's a better forum for my question, please advise.
    Thanks!
    Greg

    Which particular Mac OS are you running, psychmac?

  • Looking for a simple drawing application for my grand-daughters

    Well, that's more or less it, I'm looking for a simple drawing application for my grand-daughters. In the children section of iTunes store, there's only a few books and nothing more. I bought the iPad mainly for my grand-children to teach them a bit and I don't find interesting things for them.
    Can anybody help me with that?
    Pedro Godfroid Goffin

    Brushes is a nice finger drawing app. Since you didn't say how old they are, I don't know if the interface is to difficult for them to use.
    Sketchbook is another nice drawing app.
    Neither are free.
    Glor

  • Looking for a simple way to convert a string to title case

    New to LiveCycle and Javascript.  Looking for a simple way to convert a string to title case, except acronyms.  Currently using the the following, it converts acronyms to lower case:
    var str  =  this.rawValue;
    var upCase = str.split(" ");
    for(i=0; i < upCase.length; i++) {
    upCase[i] = upCase[i].substr(0,1).toUpperCase() + upCase[i].substr(1).toLowerCase();
    this.rawValue = upCase.join(' ');

    Thanks for the reply.
    Found the following script in a forum, which works fine as a "custom validation script" in the.pdf version of my form.  However, it will not work in LiveCycle?  The problem seems to be with
    "return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g"
    function toTitleCase(str) {
    var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
        return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title){
    if (index > 0 && index + match.length !== title.length &&
      match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
    (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
    title.charAt(index - 1).search(/[^\s-]/) < 0) {
    return match.toLowerCase();
    if (match.substr(1).search(/[A-Z]|\../) > -1) {
      return match;
      return match.charAt(0).toUpperCase() + match.substr(1);
    event.value = toTitleCase(event.value);

  • Looking for a simple flip book template for Flash CS5

    Hi, I'm looking for a simple flip book template for Flash CS5 for a 20 page brochure/ booklet. Or a tutorial. Does anyone know of one?
    Thanks!

    Hi Mark,
    No need to restrict your choice to the preset Pages Templates. Do a web search and choose a Word template. Pages will open Word documents and templates. Or design your own:
    This is a Table I inserted into a blank Pages Word Processing document. Format the date column in Inspector > Table > Format > Cell Format. Select the first Date cell,then drag the fill handle down to increment the dates.
    Regards,
    Ian.

  • Looking for a simple tutorial to building my first responsive web site in Dreamweaver CC.

    I am looking for a simple tutorial to building my first responsive web site in Dreamweaver CC.
    I have watched the tv.adobe video 3 times and I cam not able to do the actions the author shows.
    help.
    Ken Edwards

    Responsive and simple don't go hand-in-hand.  First do some prep-work to understand the concepts.
    Responsive Web Design
    http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/
    Introduction to CSS Media Queries
    http://www.adobe.com/devnet/dreamweaver/articles/introducing-media-queries.html
    Jump start your RWD projects with any of the Responsive Frameworks below:
    Foundation Zurb
    http://foundation.zurb.com/templates.php
    Skeleton Boilerplate
    http://www.getskeleton.com/
    Initializr (HTML5 Boilerplate, Responsive or Bootstrap)
    http://www.initializr.com/
    DMX Zone's Bootstrap FREE extension for DW
    http://www.dmxzone.com/go/21759/dmxzone-bootstrap/
    Project Seven's Page Packs (Commercial CSS Templates)
    http://www.projectseven.com/products/templates/index.htm
    Have fun!!
    Nancy O.

  • Looking for a simple voice to text app

    I am looking for a simple app that will recognize my contacts and create voice to text messages. What is the best? Thanks for your help!

    Thanks, this app is simple and it works well. It has good voice recognition.

  • I'm looking for a simple Notebook template for Pages.  Any help?

    I'm looking for a simple "notebook" looking journal that can be used in Pages.  This can also be a journal that has dates; actually, that is preferable, but just a notebook is a minimally satisfactory template.

    Hi Mark,
    No need to restrict your choice to the preset Pages Templates. Do a web search and choose a Word template. Pages will open Word documents and templates. Or design your own:
    This is a Table I inserted into a blank Pages Word Processing document. Format the date column in Inspector > Table > Format > Cell Format. Select the first Date cell,then drag the fill handle down to increment the dates.
    Regards,
    Ian.

  • Looking for a way to increase the sildeshow size in iWeb

    I'm looking for a way to increase the slide show size from the pictures page in iWeb. It looks like it iPhone sized. I have tried it on 4 different computer with the same result

    There's really no easy way of doing so without post publication editing of some of the support files.  There were other topics earlier on this subject but no one was able to do it .
    You can use 3rd party java script slideshows instead of iWeb's.  Examples of some are:
    Jalbum - it has over 100 themes/skins to choose from and many will let you set the size of the slideshow image. An example can be see on this demo page: Jalbum Examples.
    Other options are:
    SimpleViewer and Flash Album Exporter
    Flash Album Exporter Postcard and AutoViewer Slideshow Themes
    The last two are from an iPhoto plugin.
    OT

  • I am looking for a simple app to enable me to crop a face from one pic to another(fun). is it possible to do this via iPhoto or aperture?

    i am looking for a simple app to enable me to crop a face from one pic to another(fun). is it possible to do this via iPhoto or aperture?

    No, you will need something more advanced, like Photoshop.

  • I am looking for an simple app to do invoices. I only need to send around 6 invoices per week and they are usually paid by cheque. I need to be able to tick these as paid and keep a list of unpaid invoices so I can send reminders. Any suggestions please?

    I am looking for an simple app to do invoices. I only need to send around 6 invoices per week and they are usually paid by cheque. I need to be able to tick these as paid and keep a list of unpaid invoices so I can send reminders. Any suggestions please?

    I am looking for an simple app to do invoices. I only need to send around 6 invoices per week and they are usually paid by cheque. I need to be able to tick these as paid and keep a list of unpaid invoices so I can send reminders. Any suggestions please?

  • I have the new version of iMovie, and when i try to start the program, i can't because it says that it is looking for some movie files from the Iphoto, so all the program is locked up... how can i do to restart the program??

    i have the new version of iMovie, and when i try to start the program, i can't because it says that it is looking for some movie files from the Iphoto, so all the program is locked up... how can i do to restart the program??

    Hi
    Did You ever use - iPhoto ?
    Did You may be direct iPhoto to a different Photo Library
    As iMovie tries to find the appropriate photo library - it can get lost if iPhoto direct it into a Library on a not connected external hard disk or to a strange location - And iMovie HANGS.
    Do - When no other program is running that might interfere
    • Start iPhoto - BUT NOW KEEP alt-key (option key) DOWN during the full Start-Up process
    • Now iPhoto let's You select Photo Library
    • Select the one in Your Account / Home folder / Pictures ! !
    • Then iPhoto should start up OK
    • Now Quit iPhoto
    • START iMovie
    Does it still hangs - then I would suspect - iMovie Pref. file
    If it Run's OK - Then HURRAY !
    Yours Bengt W

Maybe you are looking for