https://bugs.kde.org/show_bug.cgi?id=478808

--- Comment #4 from lc...@april.org ---
(In reply to Jazeix Johnny from comment #3)
> You're right, then let's implement it the correct way :)

I do not really want to look at the existing code (you certainly know how long
it usually takes to enter a code you have not written).  Anyway, if a feedback
at level 1-4 is stored in a std::vector<Key_peg> (where Key_peg is an enum,
with three values, for black, white and nothing) of size the number of pegs in
the code (3 at level 1, 4 at level 2, etc.), then the same could be done for
the harder levels.  A mere function could take such a feedback and return a
std::pair<unsigned int, unsigned int>: how many black pegs and how many white
pegs.  It would simply iterate over the vector and, at each iteration,
increment the proper counter or none (for the nothing Key_peg).  If a feedback
at level 1-4 is *not* stored in a std::vector<Key_peg>, well, maybe doing so
would be "the correct way".  :-)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to