Computing the number of close to perfect pegs

04 Aug 2025 - 19:04 | Version 1 |
For each color it is: the min of the total of that color in either string - the number of perfect ones for that color.
For example: if the solution was 12313145 and guess was 12233444.
  • For 1, it is min(3,1)-1=0.
  • For 2, it is min(1,2)-1=0.
  • For 3, it is min(2,2)-1=1.
  • For 4, is it min(1,3)-1=0.
  • For 5, it is min(1,0)-0=0.
This means there is one color correct but in the wrong position (the other 3) and 4 colors in the right position. There are other ways to compute this that will also work nicely.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine