boateye's Recent Forum Activity

  • WOW Korbaach! That is just the kind of functionality i was looking for! Also, i appreciate the extra effort you put into basically making a Minimum Viable Product version of the game i described! I will certainly utilize some of your ideas, and give you credit when i finish

    Thanks again!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have searched many permutations of the above title on the forum,s but have not found something that was, at least obviously, the answer to my question. Sorry inadvance if this was answered already and i was too dense to understand it, initially!

    TL;DR: How do I load each individual character from a word/string into a separate element of a 1D array. Ex.: "bell" is loaded into a 1D array like: {b,e,l,l}

    My situation:

    Players tare tasked with guessing a word or words within a given category, and when a player enters their guess, the game will return out how many letters are in common between the word they guessed and the "target word".

    The way I've theorized how I can have my game do this comparison is to load individual letters of the "target" word into an array. Then, when the player submits a "guess" word, to compare it to the "target" word, increment a global or local variable whenever it finds a common letter between the two words, and then return the local/global variable for the player to see.

    EX:

    1) The "target" word to guess is: "bell"

    2) The array stores the "target" word as : {b,e,l,l}

    3) Player submits "love" as a guess

    4) "love" i loaded into another array like: {l,o,v,e}

    5) Then, each letter in "love" is compared against each letter in "bell".

    6) Since these two words have 2 letters in common (l and e), then the game will return 2 and display it to the player.

    To reiterate, I'm having trouble with steps 2, and 4.[/b]

    Maybe I'm going about this inefficiently, so if you think of an even better way of implementing this central function of comparing the characters of one word to another, please let me know!

boateye's avatar

boateye

Member since 19 Jan, 2015

None one is following boateye yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies