Hang man game - keeping track of already chosen letters

hello all,
I'm making a hang man game and having trouble with the solution to keep track of letters already chosen.
I have a string array where I store all the words.
Example:
String[] WordList = {"Snow White", "Johnny Carson", "John Coltrane" };
In my method to initialize a new game. I divide multi-word Strings and place them into a Vector - where each String Object becomes an element of another vector.
Example : - this is the end result - the algorithm to produce this is different. But this is the end result of randomly choosing the word snow white. This is how i'm storing the info.
Vector selections = new Vector(2);
selections.add(new String("Snow"));
selections.add(new String("White"));
Vector currentPuzzle = new Vector(selections);
This allows me to position the place holders respect to word groupings.
But i'm a little stuck on how to keep track of which letter was already chosen and should be displayed each time draw is presented ?
any ideas ?
stephen

hi!
if i understand what you need than my answer is very simple(im almost sure you ment something else):
a simple char array:
char [26] letters;//(0-a , 26-z)
and just mark in each chosen letter by the number 1.

Similar Messages

  • Hang Man

    I am attempting to develop a hang man game but, I can't get the String Buffer to work in seperating my characters. When prompting input from the user(The word to be guessed) how do I put the individual characters of the inputted word into an array. Do I have to use the String Buffer at all?
    Any hints to develop this hang man game please Respond!!!

    Hi,
    I'm not sure to nderstand ur problem.
    Just get the word to be guessed an create a new StringBuffer with it.
    Then to check characters enter to guess the word use the chatAt(int position) method in StringBuffer.
    Here a sample code that ask for the word to be guessed then a character and check if it exists in the secret word before showing where the letter appears
    char c;//char enter to guess the word
    StringBuffer word; // word to be guess
    StringBuffer found;//character found
    BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter the word to be guessed");
    word=new StringBuffer(reader.readLine());
    for (int i=0;i<word.length();i++)
    found.append('_'); // use a '______' word to begin
    //add a loop to ask for a character until the word is guessed or the game ends
    //check a letter
    System.out.println("enter a character");
    c=reader.readLine().charAt(0);
    for(int i=0;i<word.length();i++){
    if (c==word.charAt(i)){
    found.charAt(i)=c;
    System.out.println(found);
    //end loop
    Hope this helps

  • Keeping track of rows already selected

    Hi.  I'm somewhat a T-SQL noob.  The answer to my question may be obvious, but I just want to see if I have any options.  I need to scan a table for rows where a column contains a certain value, and then send an email
    to notify users of the resultset.  I'll run that scan say hourly. The table I'm scanning is in a vendor-owned database that I can't modify.  So I guess I need to keep track of previously selected rows so I don't keep notifying
    users of the same resultset, and store those in a persistent table in a separate utility database.  Right so far?  Thanks for helping me get started.

    Ok, so what you'll want to do then is just select rows that have been edited in the last hour:
    SELECT *
    FROM myTable
    WHERE last_updated_on >= DATEADD(HOUR,-1,CURRENT_TIMESTAMP)
    And you'll only get the rows that have been updated in the last hour :)
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • How do I keep track of how many times a method is called inside anthr clas?

    I am writing code for a program that solves a Knight's Tour. A Knight's Tour is a path a Knight Chess piece can take around the board starting at any spot, touching every square once, and only once. I have to write 2 classes and one is provided. The provided class is encrypted and written by our professor. All I know that it does is simulates the game using the two classes I write and provides a print out and prompts to ask the user which square they want to move to next.
    The square class I have to write consists of a constructor that makes a square object that keeps track of its color (white/black) and its status (whether it has been visited, is occupied by the knight, or is free and has not be visited).
    The GameBoard class I have to write is what I am having problems with. I am writing a method that determines how many squares have been visited. The previous mentioned class that my professor wrote for me contains a method moveKnight();. The way the program works is that every time moveKnight() is called a square's status is changed to occupied and therefore visited later. moveKnight() will only work if the move requested by the user is a valid move.
    SO! My main problem (sorry for all the explaining, just trying to give you all the information) is that I don't know how to keep track of how many times moveKnight() is called by the program. If i can figure this out it should be simple. I'm new to java but i believe...
    if(moveKnight() is called)
    {count++;} //count is a member variable already initialized
    return count;
    the moveKnight() is called section within the if() statement is what I am unclear how to do. Please help.
    Thanks, Veritas

    in your case you want 'count' to be a class attribute rather than a local variable. But yes, incrementing it each time that the method is called will serve your purpose.

  • Do you need to use an email as an apple ID?    We have a family email which is currently the apple ID so I can keep track of purchases but i have 2 iPhones and 2 itouches. Can all 4 devices have different apple ID under the same email address. Also for th

    Do you need to use an email as an apple ID?    We have a family email which is currently the apple ID so I can keep track of purchases but i have 2 iPhones and 2 itouches. Can all 4 devices have different apple ID under the same email address. Also I wanted to know because for the game center we wanted to keep track of each individual not just o e account.  DID I MAKE SENSE

    Figured it out. Thanks.

  • HT204053 how do i keep track of my stolen iphones location?

    I useed the find my phone app and was able to locate my iphone yesterday. I made it make a noise, put it in lost mode and then i erased. I recieved four mails  want toiApple giving me proof of what I had already sone to my iphone but I wanted to keep track of my phone and I  dont know how  or where to start again. Please help...

    Once you selected ERASE, you eliminated the ability to track the device.  Sorry.

  • Can I keep track of the location of my lost iPhone using the lost mode in Find My iPhone even after the sim is removed?

    My iPhone 5 is stolen, but luckily I had Find My iPhone enabled on iOS 7. The device is currently online(cellular is on) but location services are off. Is there any way to track its location.
    Furthermore, if I turn on the lost mode and the thief turns off cellular data, would I be able to keep track its location?

    Unless you enabled Find My iPad on it before it was stolen then there isn't any way to locate it. If you did enable it then you could try locating it either via http://icloud.com on a computer or Find My iPhone on another device - but that will only work if it's connected to a network and the device hasn't already been wiped and/or Find My iPad disabled on it.
    If it was stolen then you should report it to the police. You should also change your iTunes account password, your email account passwords, and any passwords that you'd stored on websites/emails/notes etc.
    If it was never registered to your account then it won't appear on your support profile : https://supportprofile.apple.com/
    The only other ways to find it that I know of (apart from on the actual device) are via the packaging, the backup on a computer's iTunes : http://support.apple.com/kb/HT4061

  • Best way to keep track of family members, etc

    Hi-
    I am a hobby photographer, and have been playing around with the trial version Aperture to replace iPhoto, and I have some questions.
    1. What is the best way to keep track of family members? For example, I like to basically keep track by setting keywords, adding a keyword for each family member & dog. Is this still the way to do it in aperture, or is there a different solution?
    2. If keywords are still the way, what is the fastest way to do this (in particular for multiple files at a time)? The various keyword buttons & shortcuts seem to only apply to one image at a time, whereas the batchchange option seems to only rely on freeform text-- which makes it likely that somewhere along the line I will get a typo.
    Thanks,
    -jamie

    You can apply a keyword to multiple images by selecting a group of images and dropping a keyword from the keyword HUD onto one of the selected images.
    I created keywords in the keyword HUD for family members, events (Christmas, Birthday, Vacation etc.), and some other things. Keywords you have already typed into an image will be in the keyword HUD already. I created a hierarchy of keywords such as:
    People
    -Family
    --(names)
    -Friends
    --(names)
    Events
    -Holidays
    --Christmas
    --Halloween
    Sorry for the dashes to show the indentations. I tried spaces but they didn't work for some reason.
    Message was edited by: Badunit

  • Keep track of the shopping cart for anonymous user

    Hi,
    I have the following problem on b2c site. Anonymous user can browse through the site and adds items to the shopping cart. At the checkout the login page is prompted, however login page is located on the different application server where the actual login happening. After that control is returned to my server where I need to create login object and associate the shopping cart with it. My problem is how to maintain shopping cart without losing it.
    I came with that solution : On checkout attach shopping cart to context object with unique key, then pass this unique key to the remote server, then remote server passes it back to me together with the login id, then I create new session and attach shopping cart to it after retrieving shopping cart from the context.
    I hope it will work, however I think there is a standard solution for this type of the problems. Any ideas, hints, suggestions are strongly appreciated.
    We use WebLogic 9.0 and Servlets.

    Do you have a problem keeping track of the shopping cart for a user who is logged in? No, I didn't think so. So give the anonymous user an internal name, just for your own convenience. Then keep track of the shopping cart for the user with that name. You already know how to do that.

  • How to keep tracks together in shuffle mode?

    When playing in shuffle mode you can't hear tracks in line together while they should be, e.g. in conceptalbums.
    Is there a way to overcome this?
    (You can do it with complete albums when downloading in the Library, but what can you do when the tracks are already in the Library?)

    Joepiet wrote:
    The second tab is calles 'Info' as well. Down under you have the possibilty to mark Part of a collection (Deel van verzameling). It should do the trick but it doesn't. I once tried, but I haven't found out what it does.
    In English, that is named as "Part of a compilation" and Google Translates that as "Deel van een compilatie". As far as iTunes is concerned, this means that the album has songs by different artists, albums such as the "Now X" series. It is how iTunes keeps a Various Artists album together.
    Joepiet wrote:
    I want to shuffle works, not tracks..
    Ah! I see what you want now!
    Two possibilities that I can think of (number 2 is the better one):
    Create a Playlist for each "work", by simply adding all the songs from one work to one Playlist and all songs from the next work to another Playlist and so on. Then, if you want to play one complete work, followed by another complete work, you could simply create a further Playlist and add each "work Playlist" you want to this new Playlist. To make the works random, all you could do is choose for yourself as you are adding them. You would need to play this new Playlist in order, not shuffle.
    If you originally imported this music from a CD, you could import from the CD again. But this time, combine the tracks that make up one work, as one track. iTunes names this as "Join CD Tracks" (or CD-tracks samenvoegen in the Dutch iTunes).
    In the screenshot above, I have selected tracks one, two and three and then used the options menu to find Join CD Tracks. This third option will not be visible until you select two or more adjacent tracks, as shown above.
    In the screenshot below, I have joined tracks one, two and three as one "work". Then joined tracks four, five and six as a separate work. Finally, I've joined tracks seven through twelve as a third work.
    Notice in the screenshot that the Options menu says "Unjoin CD Tracks". That is because the highlighted ones (7-12) are currently joined.
    And here it is in Dutch:
    With this second method, a work (of several tracks) will always be played as one track (or song). You can then simply add all the individual works to one Playlist, and play the Playlist in Shuffle Songs mode. That way, each work would be played in full, followed, at random, by another work.)
    And if you really need to - import the CD this second time with a slightly different album name, so that you then have two copies. One, where each song (or track) is the individual song on the album and the second where each "song" is a work.
    Now, lets hope I can get my iTunes back into "English" English, as my Dutch is not too good, even though I'm just the other side of the North Sea from you!

  • Keeping track of multiple projects

    I have an 84min movie I made years ago and want to edit a 3min trailer and a longer 12min trailer from footage I captured via the original VHS 4:3 transfer to mini-DV. I want to maintain the original 4:3 transfer but add 16:9 mattes to the two trailers.
    My concern is how to keep track of the various versions I want to make. I have already created a New Project for the full 84 min 4:3 and created a 2nd New Project that I put a 16:9 matte over. Framing is quite good too.
    I plan to make new projects for each version unless there's an easier way to keep track of everything. Nesting is also a consideration but I've never really done that before.
    Any comments, suggestions, warnings, etc. greatly appreciated.

    Not sure I understand what's wrong with the way you are doing it now.... creating new projects for each change? Or you could have one project with different sequences for each change.... Should be simple to keep track of things as long as you come up with a naming convention that works for you and then stick to it.
    rh

  • LR workflow for keeping track of copyright submissions?

    Instead of reinventing the wheel, I thought I'd ask here first.
    I have around 8,000 images in a smart collection of photos taken between Jan 1, 2010 and March 31, 2010. I've added my copyright info into the metadata and am in the process of exporting a 700px image of each image to a 1st_qtr2010_copyright folder on my hard drive before submitting them.
    I am considering adding these phrases to the Keywords into the original raw images: "copyrighted" and "submitted April 16, 2010". In the future, I should be able to search for all "copyrighted" images or a refinded search for any "submitted..." group. And when the certificate is returned for the images, I'd add one more keyword like "© completed July 20, 2010" and/or the copyright document number.
    I guess the target is to figure out how to keep track of the images already submitted, the ones officially copyrighted, and any images still needing the copyright submissions.(images that do not contain "copyrighted")
    If anyone here has a tried and tested method or workflow using Lightroom, I'd love to hear them before I go any further.
    Thanks in advance,
    M. Jackson

    Sean and Jao,
    I found the tick box now.
    I create a Keyword Set called something like "Private Keywords" and inclued the keyword "copyrighted" (with the boxes unchecked). I select one or more images, then click the copyrighted keyword in the list? I think I got it. I then add additional Private Keywords to my set and use them as needed. Right?
    Going back to my original question, I am looking for help with a workflow suggestion to help keep track of submissions to the copyright office. I see the option in LR to assign either Unknown, Copyrighted, or Public Domain in the Metadata. So, I import them into LR as unknown until I prepare the jpgs for uploading, at which point, I change all of the original RAW images to Copyrighted. At the point of uploading and payment, the images are copyrighted for most purposes, but there is still the final step of getting the certificate from the copyright office a few months later. I'd like to find all the ones submitted in that group and assign a new Private Keyword that associates the registration number and maybe date with the photos in that group.
    Unless I am missing more features in LR, assigning appropriate keywords would be necessary to keep track of the whole process. Keeping some of them private makes a lot of sense. If I were to run a copyright batch every few weeks, it would be easy to visualize eight or nine "in progress" copyright submission groups waiting for the final certificates.
    Any additional advice would be appreciated.
    M. Jackson

  • Keeping track of missing files

    I recently moved into my college dorm, and to help me out musically I got a 300GB Western Digital MyBook to keep all my tunes on. Unfortunately, I've had a couple problems with it since I've been using it, mainly when I sync up my iPod. Random songs will often come up missing in my library, and I was hoping there might be a way to easily keep track of or hunt these down, similar to the Show Duplicates feature. If not, there really should be because there's nothing quite as frustrating (at least, in iTunes) as thinking a song's playable and available to transfer only to find out that it's actually missing, and I have to go find it in the directory where all the other songs that it knows exist already have been and will always be.

    I think I may have solved this issue by copying my Library files into a folder containing the Music folder on my external, just like how the file tree is setup on the internal drive, and then holding option when opening iTunes. I'm not positive that's the best solution, but it might just work.

  • Keeping track of computers.

    I'm trying to come up with an idea to keep track of computers for a business. I was thinking of just having a text document on the C: drive that lists the Serial number, computer name, and location. Then use a Java program to query by computer name all of this information. Right now, where I work, we just use an excel spreadsheet to track them (about 300+). I'm just wondering what others have done in this situation? I'm not looking for code, just ideas, so I can build it.

    Ok, here is what I have so far.
    We tend to move computers around quite a bit. Either one fails and we replace it with another, or new ones are bought to replace the old ones. My idea, is to have a little program that I put on the computer (admin desktop) which we can open and update information (which is stored in a text documet on the C: drive). Information would be computer name, location, serial number, monitor serial number, ram, hd space, and the date it was last updated. This way, when we do move a computer, we can run this program and update the location, or if we add ram update that. I've already got this part built.
    The other program, that the admins will have, will be able to take a list of active computer names and grab that file from each of them. It will get all the information about each computer. I should be able to make it so I can find all computers in a certain room, or find all that have less then a specified amount of RAM or HD size, etc.
    Of course, a drawback will be if a computer is off when the list is updated. Another possible drawback (versus a database) would be network usage, having to query each computer one at a time.
    This isn't something that I NEED to do, it is just something that I WANT to do. More or less Java practice. Like most of the stuff I make to use at work, it may never leave my home computer.
    The database would be a lot better, it would certainly alleviate having to use the text documents. But where I work, getting access to some kind of an SQL server is a nightmare. I'm in the Military, and for us to use a server, we would have to purchase our own, and that isn't happening anytime soon. At the very least, If I wanted to use a database, I could setup a computer in the office and dedicate it for the database. Not ideal in any way!

  • Keeping track of the image sets

    Is there a way to keep track of which image sets have already been processed
    (profiles generated) ?  I've been processing them in groups and would like to be
    able to verify that a particular combination (focus distance/f stop/focal length) has indeed been added to the profile.
    Also, is there a way to compare your own profiles to the available ones other than by comparing how they process images?

    >Is there a way to keep track of which image sets have already been processed
    (profiles generated) ?
    Not currently. I think it is a good idea.
    >Also, is there a way to compare your own profiles to the available ones other than by comparing how they process images?
    No. You can open up the result lcp file in a text editor to inspect yourself .

Maybe you are looking for

  • Help! My Keyboard and mouse will not work all of a sudden on my G4

    I am having a problem with both my keyboard and mouse. I have a graphite G4 and recently had to run disk warrior on i. I have had endless problems with this computer and even have a 2nd hardrive on it since it only came with a 10Gig. Needless to say

  • I am looking for a ToDo list app that will run on both MacBook Pro

    Good morning, I am looking for a To Do List app that will run on both a iPhone 4S & MacBook Pro that will synch via iCloud?  Thanks for any help offered......Pat O'Brien

  • Slide Show screen saver

    I'm looking for a OS9 screen saver that works like the slide show screen saver in OSX. I have an old Performa that i've upgraded to a G3 and am running 9.2.2. I use it for email, iTunes, and scanning. I'm running a G4 mirror for the rest of my work.

  • Please help in correcting the Decode function

    DECODE(p_resp_key,'||'''AP'''||',LINT_LOGI_STG_ITEM_DETAILS_PKG.GET_AP_ITEM_CATEGORY_DTL(ol.inventory_item_id),ldmf_istore_order_pkg.get_wwdb_prod_description(ol.inventory_item_id)) AS description I am getting parsing errors during runtime.I believe

  • Smartform date formats not following SU3 setting or country settings.

    Hi, We have a smartform that has date fields that are to follow the format given in the country settings. But i cannot seem to make the fields be printed out by the country settings. Ís the variable field to be of a special type? I would rather not h