Need help on implementation of AI move generation

Hi, I am totally new to Java so please be patient. I am attempting to write a a card-shredding game in java and am currently in the process of writing code for the AI move generation. To generate all combinations of possible moves. I am stuck at this point because I have no idea how to implement it.
The problem is this:
Each card has a suit (Clubs=0, Diamonds=1, Hearts=2, Spades=3)
Each card has a value (Two=2, Three=3...Jack=11, Queen=12...Ace=14)
I need a method in which to generate all possible moves, based on a given vector of cards and an initial card from which to start from. I have written the card and deck classes and most of the game class. Assume you are given a vector of cards each of which have a suit and a value and an initial card to compare from.
E.g.
Initital card = Nine of Diamonds (value=9, suit=1)
Vector of cards= (3 of hearts, 4 of diamonds, 4 of clubs, 6 of diamonds, 8 of diamonds, 9 of spades, 10 of diamonds, 10 of hearts, 10 of clubs, king of diamonds, king of hearts.
Rule1 - From the given initial card, the allowed first card in the combination is any card which meet the following criteria:- (match the suit) or (match the value)
Rule2 - The cards following the second card can match (The same value as the previous card) or (value +1 or -1 of the same suit)
I would be so gratious for any feedback on my problem, I am not asking for code or anything like that, more so an approach. I am unsure of the data structures involved and method to implement this problem. Any advice would be greatly appreciated.

Given your two rules and your example vector there are alot of second cards that can be picked and from that you can use the entire vector for the 3rd card depending on the second.
Ie. there are alot of combinations and I don't want to calculate them all.

Similar Messages

  • Need help on implementing the BADI ME_GUI_PO_CUST

    Hi All,
    As per my requirement I need to do Enhancement for Unloading point field on PO.This filed will get all the department numbers applicable for the site on the line item.
    For this I need to Implement the BADI BADI ME_GUI_PO_CUST.
    The Method which needs to be Implemented is : TRANSPORT_TO_DYNP.
    Instructions have been given for the Screen design.
    Can anyone help me (with the sample code how) to Implement this method of the BADI in SE19.
    This BADI method is taking a view as an Input and I am not understanding how to proceed.
    Thanks and Regards,
    Smriti Singh

    Hi,
    my suggestion is to check the standard documentation of the interface IF_EX_ME_GUI_PO_CUST.
    After that you can check the method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP in the example implementation class CL_EXM_IM_ME_GUI_PO_CUST.
    Usefull links:
    [Re: Implementing badi ME_GUI_PO_CUST;
    [Re: ME21N - PO Enhancement using BADI;
    Kind Regards.
    Andrea

  • I need help fixing my iPod Touch 4th Generation myself

    I have an iPod Touch 4th Generation and the home button isn't working i think its stuck problem is my warranty expired and i have no money to fix it so i need help fixing it myself again my warranty expired and i have no money to fix it so HELP PLEASE

    Try:
    fix for Home button
    iPhone Home Button Not Working or Unresponsive? Try This Fix
    - If you have iOS 5 and later you can turn on Assistive Touch it add the Home and other buttons to the iPods screen. Settings>General>Accessibility>Assistive Touch
    - If not under warranty Apple will exchange your iPod for a refurbished one for:
    Apple - Support - iPod - Repair pricing
    You can do it an an Apple store by:
    Apple Retail Store - Genius Bar
    or sent it in to Apple. See:
    Apple - Support - iPod - Service FAQ
    - There are third-party places like the following that will repair the Home button. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • Need help rendering out a certain .mov codec

    I need to render out a local commercial in a certain .mov file with a specific codec which I can not find in CS5. It has to be an AVID DNx145,DNx220 or DN220x format. Where the heck is the option for that. I remember in CS4 you can just make  a movie and it would have this codec as an option but I can not find it anywhere in CS5. Need help fast, thanks.

    Start here: http://avid.custkb.com/avid/app/selfservice/search.jsp?DocId=350875&Hilite=Codecs

  • Need help : for changing the flv movie size

    i am loading my flv thogh xml link if load my flv the same
    size what i kept in my folder using script shall i change the movie
    size because lot of movies is loads dynmicaly i cannot go and
    change each and evry movie
    so some body can help me to change the movie - flv while it
    loads.

    You should be able to change the product name in Google Cloud.  The ChromeBook uses Google Cloud to print (Google Cloud uses HP ePrint).  Log into your google account and change the printer name there.
    I am an HP employee.
    Opinions expressed are mine and do not necessarily reflect the opinions of HP.
    Reminder: Please select the Accept as Solution button on the post that best answers your question. Also, you may select the Kudos button on any helpful post to give that person a quick thanks.

  • Need Help. Never could view movie on my new Apple TV

    Christmas gift of Apple TV has been very disappointing.  It appears our DSL Download spead is less than desireable for an Apple TV, however I started downloaded a movie - waiting 6 hours and went to bed.   Movie was ready the next afternoon, we sat down to start watching it  - I know I have 24 hours from the start of watching a movie to finish it - however I paused it - and hit rewind within the first 3 minutes and the movie was then no longer available for viewing.  I had to download all over again.    After waiting another 4 plus hours - it was too late to start watching the movie again as it still showed another 6 hours remaining to downloaded.   I can stream NETFLIX with no problem - but could never get the movie from ITUNES to download.  We left town for 1 day to visit family during the holiday - was so looking forward to a quite house and movie night - all to find the movie was no longer available.   I was charged only once - but never was able to watch the movie.   What options do I have?

    Welcome to the Apple Community.
    The first thing to check would be your internet download speed, you can do this at www.speedtest.net.
    HD movies require a recommended speed of 6 Mbps, while SD movies require a recommended speed of 2.5 Mbps.
    Netflix uses an adaptive format, i.e. it varies it's quality according to connection speed and can go as low as 0.5 Mbps, although it won't look too good.
    You have two options:
    You can download to iTunes on your computer, it likely won't download any quicker, but it will stay there and so don't need to worry about stopping the movie in the middle (movies downloaded to the computer will need to be fully downloaded before they will stream to the Apple TV).
    You could also switch to SD (settings > general > iTunes Store), your movies will download more quickly if you do this.

  • Need help to implement datamart or datawarehouse

    Hi all,
    we want to improve our reporting activities, we have 3 production and relational oracle databases and we want to elaborate 1 database as reporting database with historized and aggregated data responding to our reporting needs.
    The database we are using are oracle database 10g.
    actually we still are doing query to retrieve informations from databases for reporting purpose, but fropm inetrnet search i know that we can implement datamart or datawarehouse to group all aggregated information for reporting.
    The information i need are: is there a tools in Oracle for Datawarehousing, Is Oracle Warehouse Builder is the right tools as the sources of our data are all from Oracle database and some flat files.
    Could yo advise what i'm going to use for that kind of reporting needs, can i use Oracle warehosue builder to develop ETl ...
    Do i need license to use Oracle Warehose Builder
    Thanks you for your help.

    For OWB and Database and Datawarehouse , I would recomend the Oracle ' Documentation
    http://www.oracle.sh.cn/nav/portal_6.htm
    Then for tutirials check this (Database and OWB)
    http://www.oracle.com/technology/obe/start/index.html
    For OBIEE
    http://download.oracle.com/docs/cd/E10415_01/doc/index.htm
    What is the meaning of OBIEE is it Oracle Business Intelligence Enterprsie EditionYes
    Cheers
    Nawneet
    (Mark the asnwer as helpful of correct if it is)

  • Need help in implementing a note

    Gurus ,
      i need your help in implemnting the SAP NOTE
    "873422 - Error when sending an e-mail"
    I am not suer how to proceed to implement the correction speified in that note .
    it would be of great help if any body can explain me in brief  to implement atleast one correction in that note

    Hi Susin,
    The first thing for Note 873422,
    "You have created e-mails from Audit Management. The system automatically attaches a link to the display of the audit object being sent. When you send an e-mail via SAPconnect, the following error occurs: XS 829 Internal error: SO_OBJECT_MIME_GET Exception: 2."
    Are you getting this symptom in your system? and you want to apply the correction??
    After applying the correction, if the prerequisite mentioned in note 530932 is not met during sending mail.. then
    simply the link will not be attached. but mail will be sent.
    you have to apply the correction of the note using SNOTE or manually apply note by download/upload.
    For how to apply a note using SNOTE you can follow the help guide
    http://help.sap.com/saphelp_nw70/helpdata/EN/b8/3cf839fd35384de10000000a11402f/frameset.htm
    Regards,
    Debasis.

  • Need help with AS3 to play movies

    Here is my what I'm working with: Flash CS3, AS3. I have 4
    buttons and 4 movies (each button will be asigned to play one of
    the 4 movies).
    Not sure if this is the best layout but here is what's
    included in my file. I have an Actions layer, 4 buttons (on 4
    different layers), 4 embedded movies (on 4 different layers...all
    about 5-8 seconds long). I'm sure this is simple but figuring out
    the code for AS3 is like learning Chinese....I need major help with
    this.
    Lets say that my buttons have instance names like button1,
    button2, button3, button4, and my movies have instance names like
    movie1, movie2, movie3 and movie4. Here's the catch. I don't want
    the movies viewable (or seen) until the user selects one of the
    buttons. So if the user selects button1 the movie will appear (next
    to the button without any contols...just a movie with a border) and
    play. If the user hovers off or moves the mouse off the button, I'd
    like for the movie to disappear.
    Can someone please give me the the code needed so that when I
    select button1 that it will play movie1, button2 w/ movie2....and
    so on.
    Thanks for your help!

    Here is the link to the fla file.
    http://joshhicks.com/flash/flashfile.html
    I updated the link to the latest swf
    http://joshhicks.com/flash/del2.html
    I added stop(); to the 1st frame of each moive and this fixed
    the movies from playing in the background unseen. If you can help
    me with one last question...then the file will be complete. As of
    now when you select one of the movies, it plays once thru and
    starts back at frame one (loops) which is the way I want it to
    play. But if you hover off one of the buttons while the movie plays
    (lets say when the movie is showing the number 2) when you go back
    to view the same movie, it will start where you left off (it will
    start on the fram showing 2 and not 1). How can this be set up to
    play from the beginning of each movie everytime you happen to go
    back and click on the button? Thanks

  • Need help on implementing all types of footers in one xmlp report

    Hi,
    I'm working on a XMLP report where i've requirement to print different footers as below.
    Footer1 -- First page only footer
    Footer2 -- Last page only footer
    Footer3 -- Regular footer which should be printed on all pages EXCEPT first and last
    Footer4 -- Different from all above and needs to be printed only when it is single page.
    Example#1 : If the output is of single page
    ---> Page starts
    Header
    body
    Footer4 (footer for single page output)
    Example: If the output is of multi page say 3 pages
    ---> Page 1 (first page)
    Header
    body
    Footer1 (first page only footer)
    ---> Page 2
    Header
    body
    Footer3 (regular footer for all pages EXCEPT first and last pages)
    ---> Page 3 (last page)
    Header
    body
    Footer2 (last page only footer)
    Is it possible to implement all these footers in one XMLP report? if yes, it would be a great help if someone shares the logic.
    Thanks,
    Venky

    Hi,
    my suggestion is to check the standard documentation of the interface IF_EX_ME_GUI_PO_CUST.
    After that you can check the method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP in the example implementation class CL_EXM_IM_ME_GUI_PO_CUST.
    Usefull links:
    [Re: Implementing badi ME_GUI_PO_CUST;
    [Re: ME21N - PO Enhancement using BADI;
    Kind Regards.
    Andrea

  • Need help regarding implementing SSAS solution using microsoft decision trees algorithm

    Hi All,
    I am new to SSAS and Data Mining techniques. I dnt have a good knowledge about data mining in SSAS.  I have a requirement regarding predictive analysis and want to check whether i can implement SSAS for it. 
    I have two tables namely Tree and Node. The Tree table has the columns namely NodeID, ParentID and Level. The ParentID in the tree table represents a node in the node table and at the same time the nodeid in the tree table also represents the nodeid in the
    node table.
    If you run the below query, it will list out all the possibilities of getting the nodename 'CTRYIMPACT - High - PRODIMPACT - Low - Question 6'
    select p.*
    from Node n, Tree t, Node p
    where n.NodeName='CTRYIMPACT - High - PRODIMPACT - Low - Question 6'
    and n.NodeId = t.NodeId
    and t.ParentId = p.NodeId
    I want to predict the various nodenames that are possible by inputting a NodeID using analysis services. If this is done, then i can implement it in my project. 
    I went over this link to know about implementing decision tress but, they have used only a single table in the example. Since I have two tables i am struck in the middle. And also they have not specified clearly of what they need to achieve. They have just
    stated that on changing the play the value changes. 
    http://www.mssqltips.com/sqlservertip/2965/classic-machine-learning-example-in-sql-server-analysis-services/
    Can anyone help me with this?
    Below is the link for data containing the values for the Node and Tree table.
    https://www.dropbox.com/s/hpzooa039zbtkk8/analysis_services_data.xlsx?dl=0
    Thanks you and Kind Regards, Karthik Venkatraman

    Hi Karthink,
    Acording to your description, you need to predict the various nodenames that are possible by inputting a NodeID using analysis services, right?
    In your scenario, in order to make prediction in Data Mining Model, we would create a prediction query. Before we can create a prediction query, we need to build a Data Mining Model. Please refer to the links below to see the detail infomaton.
    http://msdn.microsoft.com/en-in/library/bb677206.aspx
    http://msdn.microsoft.com/en-in/library/hh213169.aspx
    http://captechconsulting.com/blog/mark-hudson/making-predictions-microsoft-data-mining-tools-%E2%80%93-part-ii
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Need help with a finished FCPX movie

    I recently upgraded to Final Cut Pro X from Express and am loving all the new features and capabilities that come with it. I just helped a friend with filming and editing a play at his school. After I finished editing it, the final MOV file is about 11 GB. Pretty big. When I try to put that file into iDVD to try to burn a DVD, my Mac begins to heat up really fast and I'm worried that this might overheat the processor.
    I've tried other means of compressing the file without losing quality, like Handbrake, but to no avail. Is there a way to compress the file down so I can burn it to a disc in a more manageable way?
    I've heard of compressor but am not all that familiar with it. Would that program be applicable to my situation?

    DVD’s can be burned directly from inside FCPX, no need to use Compressor…
    Although, Compressor offers much more flexibility.
    If the movie is played only on the computer, one could convert it to H.264 and burn that
    to a DVD as data-file.
    Otherwise, save your FCPX media as “Master File” and burn that file with Roxio “Toast”.
    Be aware, that DVD’s are standard definition, compressing HD media for a DVD
    converts the media always to standard definition.
    To burn HD media onto a disc one has to create a Blu-Ray or AVCHD-disc.

  • Need help to implement a small data warehouse or datamart

    Hi all,
    we want to improve our reporting activities, we have 3 production and relational oracle databases and we want to elaborate 1 database as reporting database with historized and aggregated data responding to our reporting needs.
    The database we are using are oracle database 10g.
    actually we still are doing query to retrieve informations from databases for reporting purpose, but fropm inetrnet search i know that we can implement datamart or datawarehouse to group all aggregated information for reporting.
    The information i need are: is there a tools in Oracle for Datawarehousing, Is Oracle Warehouse Builder is the right tools as the sources of our data are all from Oracle database and some flat files.
    Could yo advise what i'm going to use for that kind of reporting needs, can i use Oracle warehosue builder to develop ETL ...
    Do i need license to use Oracle Warehose Builder
    Thanks,

    As simple answer to all your questions: YES
    Yes, Oracle warehouse builder could be a tool to use.
    Yes, Orace warehouse builder needs a license.
    Besides that you also need a license for that extra Database.
    if you already have that, and you have the queries with which you now retrieve data, you can always choose the cheap way and build materialized views with these queries.
    Keep in mind however that a materialized view ( of snapshot ) does not support inline selects.
    HTH,
    FJFranken
    My Blog: http://managingoracle.blogspot.com
    P.S. If this answers your question, please set the thread to answered and award the points. It is appreciated

  • Need help with accessories for new 4th Generation Nano-speakers, etc

    I just purchased the new 16GB 4th generation nano and I want accessories to play with it but am concerned with compatibility and charing issues. I am new to this so my questions may not make sense!
    1. I am looking for speakers and the Logitech Anywhere Speakers have good reviews. Will I be able to play my Nano with these and charge it? If not, what ones will that are reasonably priced?
    2. What accessory can I use to play my nano in my car (older model) that will also charge it? Or are there no accessories for this as of yet.
    3. If I want to plug it into a stereo, I only need the mini/RCA cable converter, correct?
    4. To plug into the wall, I need the USB adapter-but do I need a dock as well?
    Thank you and sorry for such simple questions! This is my first iPod! :-D

    2. If you have a cassette adaptor with the 3.5mm audio plug and want to also charge your iPod. You can plug it into a Griffin AutoPilot.
    http://www.griffintechnology.com/products/autopilot
    For the car with no tape or aux you need an FM transmitter, if your in a city with a lot of stations you will get interferance (I was glad to dump mine when I got a new car). Most are 12 volt! The Griffin iTrip has 5 volt charge and works with the iPod Nano 4th Gen.
    http://www.griffintechnology.com/products/itripautopilot
    Griffin seems to be one of the few companies that switched to 5 volt charging some time ago.
    3. A line out cable is something like this...
    http://www.amazon.com/Cables-Go-35507-Connector-Cable/dp/B000JG3WBY/ref=sr111?ie=UTF8&s=electronics&qid=1221776257&sr=1-11
    Better then using the headphone jack to hook up to a stereo.
    4. For the dock a 3.5mm to RCA cable should be all you need to get line out to your stereo.

  • Need help including Slideshow with my movie

    I have read on these forums that I should "share" my slideshow from Iphoto in order to keep everything intact. Music, burns effect etc.
    I had a movie started in IDVD. I wanted to include the slideshow. It seems like when I share my Slideshow, it wants to open a new project??? How do I get them into one project?
    I thought about creating my slideshow IN IDVD, but it doesn't allow me to use the Ken Burns effect or "random" transitions.
    I hope someone knows what I'm talking about.
    I appreciate any help!
    Bill

    O.K. this is what I did. I created a "New" Slideshow and then tried to drag to this location. Wouldn't take.
    I deleted the "New" slideshow in my menu and then dragged the "movie" slideshow into the main menu (no particular location, just IN it) and it took! Then I just changed its description to say Slideshow.
    Your help is appreciated!
    Bill

Maybe you are looking for

  • How do i find my ical data

    i have looked in the application support folder but there are lots of files there.....if i need to restore that data....where do i get it?? thanks so much.

  • Error while storing the movie

    Independent of the movie storing method (MPEG - PAL DVD-Standard, etc.) I always get an error message "Error during export: Error during creation of the movie. Unknown error," at the end of the process. I have enough RAM (4 GB) and disk space (555 GB

  • Ecess % problem  in Purchase Return Invoice

    Dear Freinds, I have an issue , I am executing a Purchase return cycle for an item, the BED, Ecess, SE Cess, for this material is zero, it carries only 13.5 VAT, accordingly I have maintained the Condition for this tax code in FV11,  I remove an Exci

  • Can't Open Contacts . . . received the following

    Process:         Contacts [857] Path:            /Applications/Contacts.app/Contents/MacOS/Contacts Identifier:      com.apple.AddressBook Version:         7.0 (1143) Build Info:      AddressBook-1144000000000000~11 Code Type:       X86-64 (Native) P

  • Simple var question

    when i declare a variable using "var", is it relative only to the timeline it is declared on? for example, can i have the a variable named "location" in two different movie clips? will flash know the difference between the variable in each movie clip