• Mastermind puzzle (with 3 digits)

    From HenHanna@HenHanna@gmail.com to rec.puzzles,rec.puzzles.crosswords on Sun Feb 25 13:07:49 2024
    From Newsgroup: rec.puzzles.crosswords


    What's another great problem like this one?


    (i just wrote (non-elegant) Python code.)


    Could you share a short, VERY Readable Pythonic code that solves this?

    Thank you!


    https://i.imgur.com/72LGJjj.jpeg

    3 digit lock
    [682]: One number is correct and well-placed
    [614]: One number is correct but wrongly placed
    [206]: Two numbers are correct but wrongly placed
    [738]: Nothing is correct
    [780]: One number is correct but wrongly placed


    HINT -- A mark of a great puzzle, this one contains a surprise or two.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Ammammata@ammammata@tiscali.it to rec.puzzles,rec.puzzles.crosswords on Mon Feb 26 08:57:57 2024
    From Newsgroup: rec.puzzles.crosswords

    HenHanna laid this down on his screen :
    3 digit lock
    [682]: One number is correct and well-placed
    [614]: One number is correct but wrongly placed
    [206]: Two numbers are correct but wrongly placed
    [738]: Nothing is correct
    [780]: One number is correct but wrongly placed

    042
    --
    /-\ /\/\ /\/\ /-\ /\/\ /\/\ /-\ T /-\
    -=- -=- -=- -=- -=- -=- -=- -=- - -=-
    ........... [ al lavoro ] ...........
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Carl G.@carlgnews@microprizes.com to rec.puzzles,rec.puzzles.crosswords on Tue Feb 27 10:30:03 2024
    From Newsgroup: rec.puzzles.crosswords

    On 2/25/2024 1:07 PM, HenHanna wrote:

    What's another great problem like this one?


    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a (i just wrote (non-elegant) Python code.)


    Could you share a short, VERY Readable Pythonic code that solves this?

    -a-a-a-a-a-a Thank you!


    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a https://i.imgur.com/72LGJjj.jpeg

    -a-a-a-a-a-a-a 3 digit lock
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a [682]: One number is correct and well-placed
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a [614]: One number is correct but wrongly placed
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a [206]: Two numbers are correct but wrongly placed
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a [738]: Nothing is correct
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a [780]: One number is correct but wrongly placed


    HINT -- A mark of a great puzzle,-a this one contains a surprise or two.

    I currently don't have time to write code (plus I don't write a lot of
    Python code), but I would suggest writing a Boolean function that takes
    the test number, a "correct and correctly placed" count, and a "correct,
    but wrongly placed" count, for arguments and returns "True" when the
    clue conditions are met, "False" otherwise. Then call the function
    within a loop that cycles over all allowed numbers and checks if all conditions are met for each number. It may not be any more "elegant"
    than the code you wrote, but it could be easily adapted for other
    problems (different clues, only test for digits 0 to 4, etc.) The code
    could be made very readable, especially if clues are each on their own
    line. If letters were used instead of digits, the function would not be limited to ten values. The function could also be used as a tool to
    create similar puzzles by looking for clue-sets that yield unique
    solutions.

    ObPuzzle1: Write a "one-liner" program (in Python, Powershell, Basic
    script, etc.), that, although inelegant (even obfuscated :)), finds the solution.

    ObPuzzle2: How many five-clue "clue-sets" for 3-digit numbers (like the example) have an unique solution? The clues could be 0 to 3 "correct
    and well-placed, 0 to 3 "correct but wrongly-placed" (up to 3 "correct").
    --
    Carl G.


    --
    This email has been checked for viruses by AVG antivirus software.
    www.avg.com
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From HenHanna@HenHanna@gmail.com (HenHanna) to rec.puzzles,rec.puzzles.crosswords on Tue Feb 27 18:59:44 2024
    From Newsgroup: rec.puzzles.crosswords

    Carl G. wrote:

    On 2/25/2024 1:07 PM, HenHanna wrote:


    I currently don't have time to write code (plus I don't write a lot of Python code), ................


    ObPuzzle1: Write a "one-liner" program (in Python, Powershell, Basic script, etc.), that, although inelegant (even obfuscated :)), finds the solution.

    thanks.... i'll try




    bard.google.com (now Gemini) can't write Python code that solves this. Can ChatGPT do it?



    re: constraint satisfaction problem (CSP)

    i have Knuth's book on CSP... i'll check inside.


    i studied Prolog when i was younger. (Wrote a Prolog interpreter in Lisp, etc.)


    Is this a typical easy exercise in Prolog programming? Could someone share Prolog code for it?
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Blue-Maned_Hawk@bluemanedhawk@invalid.invalid to rec.puzzles,rec.puzzles.crosswords on Sat Mar 2 22:10:28 2024
    From Newsgroup: rec.puzzles.crosswords

    HenHanna wrote:

    What's another great problem like this one?


    (i just wrote (non-elegant) Python code.)


    Could you share a short, VERY Readable Pythonic code that solves this?

    Thank you!


    https://i.imgur.com/72LGJjj.jpeg

    3 digit lock
    [682]: One number is correct and well-placed
    [614]: One number is correct but wrongly placed
    [206]: Two numbers are correct but wrongly placed
    [738]: Nothing is correct [780]: One number is
    correct but wrongly placed


    HINT -- A mark of a great puzzle, this one contains a surprise or two.

    My answer: mreb sbyybjrq ol sbhe cerprrqvat gjb frrzf gb zrrg nyy bs gur erdhverzragf.

    Now to see if i was correctrCa
    --
    Blue-Maned_Hawk|a-a-a-a-a|a-a-a-e|a-a-e|a-e|e-o-o-eshortens to Hawk|a-a-a-a-a|a-a-a-e|a-a-e|a-e|e-o-o-e/ blu.m|a-a-a-a-a-e-cin.d|a-a-a-a-a-e|a-a-a-a-e|a-a-a-e|a-a-e|a-e|e-#ak/ |a-a-a-a-a|a-a-a-e|a-a-e|a-e|e-o-o-ehe/him/his/himself/Mr. blue-maned_hawk.srht.site
    rCaassuming i'm understanding things correctly, which i may not be.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From HenHanna@HenHanna@dev.null to rec.puzzles,rec.puzzles.crosswords on Sun Mar 10 01:07:28 2024
    From Newsgroup: rec.puzzles.crosswords

    Blue-Maned_Hawk wrote:

    HenHanna wrote:

    What's another great problem like this one?


    (i just wrote (non-elegant) Python code.)


    Could you share a short, VERY Readable Pythonic code that solves this?

    Thank you!


    https://i.imgur.com/72LGJjj.jpeg

    3 digit lock
    [682]: One number is correct and well-placed
    [614]: One number is correct but wrongly placed
    [206]: Two numbers are correct but wrongly placed
    [738]: Nothing is correct [780]: One number is
    correct but wrongly placed


    HINT -- A mark of a great puzzle, this one contains a surprise or two.

    My answer: mreb sbyybjrq ol sbhe cerprrqvat gjb frrzf gb zrrg nyy bs gur erdhverzragf.

    Now to see if i was correctrCa
    --
    Blue-Maned_Hawk|a-a-a-a-a|a-a-a-e|a-a-e|a-e|e-o-o-eshortens to Hawk|a-a-a-a-a|a-a-a-e|a-a-e|a-e|e-o-o-e/ blu.m|a-a-a-a-a-e-cin.d|a-a-a-a-a-e|a-a-a-a-e|a-a-a-e|a-a-e|a-e|e-#ak/ |a-a-a-a-a|a-a-a-e|a-a-e|a-e|e-o-o-ehe/him/his/himself/Mr. blue-maned_hawk.srht.site
    rCaassuming i'm understanding things correctly, which i may not be.





    Here, i can see your XFACE, but...

    Your sig seems to contain strange chars.
    --- Synchronet 3.21d-Linux NewsLink 1.2