Hi guys (and propably girls, hope there are some:D), I have a question that deals with the realization of a certain task and not the coding itself (well not completely). I am working on a small HANGMAN game for my little brother (you can imagine how impressed he is when using the game his brother did :cool: ) and I know how to import the text file with all those words, how to obtain a certain string, how to search this string for a specific char and how to even find it. BUT ... how would you go and make the actual hide/show part, meaning hiding the word and only showing those parts that were already guessed? Would you
  • just use a text painted on the window and define the single colors for the chars
  • use something that you put over those chars that are not yet ready to be revealed
  • use blank boxes and insert the correct chars into the specific ones
  • do anything else that a simple minded person cannot think of (with regard to the fact that it is 23:36 in Germany now)
  • Hope to get an answer soon. Stefan This message was edited by Stefan Krause, on 2/25/2001 2:57:38 AM
    Posted on 2001-02-24 17:32:00 by Stefan Krause
    Damm, I'm going to have to type this in again! I hit backspace and IE went back a page! Ok, this is how I would do this, there are many ways. First setup a buffer string the lenght of the word you'll be trying to guess. Set every character in it to a blank character eg. "?" After a guess, you say you know how to scan through the word to see if the letter occurs, everytime it occurs you'll know it location by whatever counter your using to scan through the word, set the bytes in the buffer string at those locations to the guessed letter. Its simplist to do this as you find the letters not after searching the whole word. At this stage you simply print out the buffer string. For example: if the word to guess is ASSEMBLY and the guessed letter is M then it should be found 4 bytes in. So the buffer string would be changed at that location. It should then read: ????M???
    Posted on 2001-02-24 18:19:00 by Zadkiel
    if i was doing it, you can then use a routine to print out the guess string, instead of simple textout. you can go through each character, and if it is a blank, maybe print an underscore, and if a guessed letter, print that out in a different colour. Only an idea though. Good Luck, and be sure to make the available product online, im sure my neice would love it.
    Posted on 2001-02-24 19:24:00 by mega
    You could just have one buffer with the string and found letter are capital, while unfound letters are lowercase. I'd do the same for guessed letters of the alphabet. You would need a routine that prints just he capital letters of a string to the screen, and puts an underline of space for lowercase. bitRAKE.
    Posted on 2001-02-24 23:36:00 by bitRAKE