10 duke dollars available for this smple doozy!

I have just started using Java, and already I need to create a simple game, but I am having problems already.
The game is designed for 2 player with the one human player and the computer. Players alternatively take sticks from a pile, the player taking the last stick loses.
The game needs to include:
1. A random integer between 10-80 to generate the pile of sticks.
2. Implement a smart mode, which means that if the computer starts the game it cannot lose.
3. Have the facility to play the game reapeatedly without restarting the game.
It should look like this:
The starting size of the pile is xxx sticks
The 1st player is: yyy
The 2nd player is: computer
Playing in the MMM mode
The ppp starts the game:
turn:yyy --->> removes QQQ sticks
turn: computer --->> removes QQQ sticks
The winner is: computer!
Another game? (yes/no)
Any Ideas?
Many Thanks...
Dr. K

I don't understand your game as described but it sounds a lot like nim or one of it's many variants. Do a google search on "nim" for plenty of info. Here is a start:
http://www.csm.astate.edu/Nim.html
http://www.chlond.demon.co.uk/Nim.html
Note that traditionally nim is played with multiple piles.
The game needs to include:
1. A random integer between 10-80 to generate the pile
of sticks.Look at the Random class.
2. Implement a smart mode, which means that if the
computer starts the game it cannot lose.Here you have to devise and code a winning strategy. That could be quite challenging depending on the rules of the game.
3. Have the facility to play the game reapeatedly
without restarting the game.This is pretty simple. I don't want to sound discouraging but if you can't figure this out then step 2 is out of the question.

Similar Messages

  • SharePoint 2013: A web analytics report is not available for this site.

    Hello,
    I have SharePoint Server 2013 and the enable usage data collection is enabled.  There is usage logs and data being generated, but SharePoint says there is not data available.
    A web analytics report is not available for this site. Usage processing may be disabled on this server or the usage data forthis site has
    not been processed yet.
    What can I do?
    Thanks,
    Paul
    Paul

    hi,
    Web Analytics is now part of the 2013 Search.
    You can refer the below links, :
    http://blogs.msdn.com/b/chandru/archive/2013/08/31/sharepoint-2013-web-analytics-report-where-is-it.aspx
    http://www.collabshow.com/2013/05/23/sharepoint-2013-analytics-a-big-step-backward/
    http://usamawahabkhan.blogspot.com/2013/06/sharepoint-2013-analytics-features-how.html 
    if you wanna use  API, there is a blog,which talk about the same:
    retrieve  Search Analytics Reports
    using SharePoint 2013 API:
    http://radutut.wordpress.com/2013/01/27/how-to-get-search-analytics-reports-programmatically-in-sharepoint-2013/

  • Problem updating to iphoto 9.6 after upgrading to Yoesmite  I am getting the following message when I try top date iPhoto This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or canc

    problem updating to iphoto 9.6 after upgrading to Yoesmite  I am getting the following message when I try top date iPhoto This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or canc

    "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." ?
    This error message will appear erraneously, if you skipped the update to Mavericks and iPhoto 9.5.1 and went straight from an earlier MacOS X version to Yosemite, without first updating to iPhoto 9.5.1 and associating iPhoto to your AppleID.
    Try first to buy iPhoto with your AppleID instead of updating. Delete iPhoto from Applications, but don't empty the Trash, then go to the main page of the App Store and search for iPhoto. If you are lucky, it will show as free and you can buy it directly.
    If iPhoto  is not showing as free, there is no help but contacting the App Store Support: Ask for a redemption code. You will need to provide a prove of purchase for your mac with iPhoto preinstalled.
    http://www.apple.com/support/mac/app-store/contact/

  • I've searched to no avail for this problem. Similar posts but none that tell me what to do. I can't add or delete any bookmarks on my iPad 2 running the newest iOS. I know how it's suppose to work, it just isn't working!

    I've searched to no avail for this problem. Similar posts but none that tell me what to do. I can't add or delete any bookmarks on my iPad 2 running the newest iOS. I know how it's suppose to work, it just isn't working!
    It started after the major update to iOS 7.
    I can't believe that this is so hard to do. It's just not letting me. I can add a bookmark to the home screen just fine, just not in a bookmarks folder anywhere I try.
    I've used Apple products since 2001 and have always loved how intuitive they are. But the Safari browser since iOS 7 has been the worst I've experienced. At least right in the beginning after that update.
    I'd really appreciate any help that doesn't just tell me how it's suppose to work...I know that.
    My iPad 4 is not affected with the problem and works as it should.

    To delete, tap "Edit" (tap to enlarge image)

  • I can't update my iPhoto. "Update is not available for this Apple ID".

    Updating my iPhoto has always been a problem.  When I try, I get the error of: "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled."
    This is the only apple ID I have ever owned, and now that I updated my Mac with the new software, I can't even OPEN iPhoto anymore. Now I can't view any of my photos and I am not a happy camper..
    How can I fix this problem?????
    Thanks in Advance!

    Contact App Store support. There's a link on the right hand side of the App Store Window. They're the only ones who can sort out account issues.

  • Valid size not available for this creation when using Greeting Card feature

    Using PSE9 with a Mac.  When attempting to create a greeting card, after selecting the photo, the Greeting Card, I receive a pop up error message as follows:
    "Valid Size Not Available For This Creation".  (All other Create functions such as Photo Book, Photo Calendar, and Photo Collage appear to be working).  I have been in contact with Adobe Support and have been instructed to do a number of things from creating a new preferences file to uninstalling and re-installing the PSE software, with no result.  Has anyone else run into this problem, and if so have found a fix?  Thanks.

    I've been tearing my hair out over this one also. I've been on hold for over 10 hrs with Adobe Support waited over almost 2 weeks and still no resolution. I'm trying to create the Save the Date cards for my wedding and I can't wait for Adobe. Removing the preferences file and uninstalling/reinstalling does not fix the problem.
    That said I did figure out a workaround for this. It's easy but it does require Windows. For me this was no big deal as I do own a Windows box.
    Get the free trial version of PE9 for Windows and install it. If you don't have a Windows computer get to a friend that has one
    Upload some of your photos to the PE9 Windows Organizer (it's identical to the mac version)
    Select Create and then Greeting card. Photoshop will launch the guided edit feature for greeting cards.
    Select the Layout feature and once you find out that you like save it as Photoshop project. Repeat this step for as many layouts as necessary.
    Copy your Photoshop project files (and any folders) to your mac.
    Open the project files as you would with any other Photoshop file.
    You can now select the Create feature. You will be able add your pictures and resize them, you will be able to add/remove text, you'll be able to change the backgound/borders, add graphics...pretty much anything...EXCEPT automatically modify the layout. If you click on Layout, PE9 returns nothing. You can however go into full edit mode and if you have decent Photoshop skills you can make any changes to the layout manually.
    If I had to put money on this I'd say that there is a problem with the PE9 Mac installation package. For some reason it is not deploying the layout data/files or it is not putting them in the right place. For this reason the program can't find the layouts when the user selects the greeting card guided edit.
    Good luck.

  • There are no active responsibilities available for this user

    Hi Guys...
    I am not technical person... but wanted to if anybody has experienced the following problem:-
    When logging into any account i get the following message:- There are no active responsibilities available for this user
    No i have looked the threads posted and most advise to run the WF_SYNCHRONIZE_LOCAL_TABLES concurrent request.. if i run this through toad or UNIX as i can’t get into forms i always seem to get the following message which could be playing a part in my initial problem.....ORA-00600: internal error code, arguments: [ktsircinfo_num1], [9], [33], [52844], [], [], [], []
    When i also query the following table Fnd_User_Resp_Groups i also get the following message: ORA-00600: internal error code, arguments: [ktsircinfo_num1], [9], [33], [52844], [], [], [], []
    any help would be most welcome......
    Bal

    Is the system in maintenance mode, by any chance ? You put the app in maintenance mode when applying patches. If you connect as the apps database user, what does this sql statement return ?
    select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;
    MOS Doc 400151.1 - After Login Receive Error: 'There are no active responsibilities available for this user'
    If the system is not in maintenance mode, you only option would be to open an SR
    HTH
    Srini

  • Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotfo

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

  • I purchased a new Mac Air. I try to update apps and I get this:This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. They do not show up in 'Purchases'.

    I can't update iMovie, Garage Band, Numbers, Pages, Keynote, and iPhoto. on my new Mac Air. 11". I had hoped when I updated to OS X Yosemite that would solve the problem. It didn't. I get this: This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. I went to the app store, as was suggested in someone else's post, using the only ID I've ever had, and went to the purchases tab, to "accept" the apps. That didn't work, because they weren't there to 'accept'. They did come with my purchase, however. Please advise.

    It appears Best Buy is up to their old tricks of palming off returned units as new. Take it back for a complete refund of your money. If they give you any static escalate your problem to management immediately.

  • Macbook pro - iPhoto keep prompting to update after Yosemite update. Error message when trying to update -This update is not available for this Apple ID either because it was bought by a different user or the item was cancelled

    macbook pro - iPhoto keep prompting to update after Yosemite update. Error message when trying to update -This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. 

    I only have 1 apple ID and the same was used to set up this early 2011 macbook pro and iPhoto app. I don't want to loose out on any photos. I tried logging out of app store and back in but no luck. PLEEAASEE HELPP!!!
    This problem has been reported by quite a few forum members, who skipped the update to iPhoto 9.5.1 while running Mavericks. In that case try to purchase iPhoto again instead of updating.
    After making your backup try the following:
    Uninstall iPhoto by deleting it from the applications folder, but do not empty the Trash.
    Launch the App Store, click the "Store" menu, and sign in with your AppleID.
    Open the main page of the App Store and search for iPhoto.
    If iPhoto is listed as "Free", click the "Free" button to buy it with your current AppleID.
    If it is not showing as free, there is no help but contacting the App Store Support, as Niel pointed out: http://www.apple.com/support/mac/app-store/contact/

  • When trying to perform updates I get this message. This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. What do I do?

    When trying to perform updates I get this message: This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. What do I do? I just bought the MacBook Pro new and migrated my apps from my old MacBook Pro.

    Perform the following, stopping with the first one which works:
    1. Open the Mac App Store's Purchases tab. If you're prompted to accept them into your Apple ID, do so.
    2. Move them out of the Applications folder(they may need to be put into the Trash temporarily), and then see if you can download them for free from their individual product pages. If you're asked to buy them, see #3.
    3. Click here, contact Apple, and wait for a response.
    4. Buy them.
    (116300)

  • Adobe Media Encoder update is available for this version

    When I exporting a sequence in Adobe Premiere Pro CS5, there comes a screen appears and indicates that "Adobe Media Encoder update is available for this version."
    I go to the page "www.adobe.com / go / updates and downloads" Adobe Media Encoder CS 5.5.1 for windows 64-bit "
    Subsequently I start the download file and get a message "Some updates were not installed"
    How do I fix my problem and get the latest update installed, or get Adobe Premiere Pro CS5 for not knowing modest and the available update for "Adobe Media Encoder"

    I selected run as administrator, no effect.
    I am using version 5.0.3, on win7  when i select help and update the adobe application manager reads "your aplications are all up-to-date", i would assume this is the current version.
    No matter what i try to export from any project regardless of codec or output i receave this message
    "an adobe media encoder update is availiable for this version of premierepro. to download the latest update, pleas run  the adobe updater form the help menue orvosot http://adobe.com/go/updates."
    I went to the help menue and selected help and i still get the adobe application manager "your aplications are all up-to-date"
    thanks for the help

  • I cannot update iPhoto as I receive a message saying update not available for this Apple ID as either it was bought by a different user or was cancelled

    I have inherited my daughters Macbook Air and am trying to update i photo. The message I receive is - update not available for this Apple ID either because it was bought by another user or item was refunded or cancelled.
    I have tried her ID which was still unsuccessful.
    I cannot access my photos at all. Can anyone help?

    Hi Queenstown2014,
    Sign onto her Apple/iTunes ID in the iTunes Store. Then click on the iTunes ID and then on Account in the dropdown. Once you have her account screen displaying, scroll to the bottom and click on RESET next to the line "Reset All Warnings for Buying and Downloading", then try again (with her iTunes ID still signed on).
    Cheers,
    GB

  • IPhoto update can't be installed on my MAC ref. "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." this is not possible help?

    Recent upgrade to OS X Yosemite on my MAC and iPhoto update can not  now be installed msg reads, "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." this is not possible help?

    That error message can be misleading. It means, that iPhoto on your Mac is not associated with your Apple ID.
    Either you did not set up  your Mac using the same Apple ID - did someone help with your setup and use a different ID? Perhaps a family member? Or did you let someone borrow your installer disks?
    Or did you not yet "Accept" iPhoto and other iLife apps to your Apple ID? Check the "Purchased" tab of the App Store, if any applications are waiting to be accepted. If you see "Accept" buttons, press them.
    You may  be unable to "Accept" now, if you missed the update to iphoto 9.5.1 on Mavericks. You could try to buy iPhoto, however. If you are lucky, it may show for free.
    Backup your iPhoto library, if you do not have a current backup.
    Uninstall iPhoto by deleting it from the Applications folder, but do not empty the Trash, so you can put it back,if need be.
    Launch the App Store, click the "Store" menu, and sign in with your current AppleID.
    Open the main page "Featured" of the App Store and search for iPhoto.
    If iPhoto is listed as "Free", click the "Free" button to buy it with your current AppleID.
    If it is not showing as free, there is no help but contacting the App Store Support to sort out the AppleID. Use this link: http://www.apple.com/support/mac/app-store/contact/

  • Why is that I am not able to update iPhoto after install os x yosemite?  is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled.

    "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled"  iPhoto is gone after installing to OS X Yosemite.  Where did it go and how do i get all my pictures back ??
    HELP !!!

    "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled"  iPhoto is gone after installing to OS X Yosemite.  Where did it go and how do i get all my pictures back ??
    HELP !!!
    Did you upgrade to Yosemite, without first updating to iPhoto 9.5.1 in Mavericks? Then updating to 9.6 may not work - it is buggy at the moment.
    If you already own a version of iPhoto 9.x.x, but cannot update iPhoto, try to buy a new version.  When I look at the AppStore, the price has now changed to "Free", so it should not matter if you buy again or update.
    Delete iPhoto from Applications, but do not empty the Trash.
    Go to the first page of the App Store and sign in with your AppleID.
    Search for "iPhoto" using the Search field.
    What does the button below the iPhoto icon show? If it is showing "Free" like for me, click "free" to purchase again.

Maybe you are looking for