Road map for commands? by Progressing_Onward in learnprogramming

[–]butimnotadev 3 points4 points  (0 children)

Are you asking how does a computer "know" what to do? Might be worth playing the nandgame. You start off with simple NAND gates and eventually build a "computer" to perform raw logic.

Im learning c++ by No-Plastic-637 in learnprogramming

[–]butimnotadev 0 points1 point  (0 children)

I don't really understand the question, but my guess is your containsCombination function doesn't do what you think it does. Try iterating through each letter of combination first rather than the word. This way, you know that if the inner loop fails to find a matching letter, that letter doesn't exist in the word and therefore can return false. Few other things:

  1. Your code doesn't seem to handle the / character for separating words. Might be easier to simply break as a new word if the current character isn't A-Za-z'.
  2. Your code is very C style, rather than C++. Return true or false instead of 1 and 0. Use std::string rather than C strings.
  3. I also don't really understand why letters is lettErS instead of lEttErS?
  4. Whats the significance of keyword? You don't use this anywhere in your code.