• Mastermind Puzzle/Game

    From porkchop@porkchop@invalid.foo (Mike Sanders) to comp.lang.awk on Fri Nov 10 22:54:32 2023
    From Newsgroup: comp.lang.awk

    Can you guess the 4-digit key? Maybe you mistakenly think its easy?

    Here's the header containing the download URL...

    # tags: mastermind, bulls & cows, game, puzzle, awk, code
    #
    # awk mastermind codebreaking game
    # Michael Sanders 2023
    # https://busybox.neocities.org/notes/mastermind.txt
    #
    # First appearing as a traditional pencil & paper game known as
    # 'Bulls and Cows', this game probably dates back to the 1900s.
    #
    # The earliest known computer program, called MOO, was written
    # by Dr. Frank King in 1968 at Cambridge University.
    #
    # You'll need awk and an ANSI capable terminal...
    #
    # Unix invocation: awk -v SEED=$RANDOM -f mastermind.txt
    # Windows invocation: awk -v SEED=%RANDOM% -f mastermind.txt

    And lastly, a screen dump of a game in progress...

    MasterMind: Q=Quit | Seed: 8865 | Key: 8071 | Stack: xxzx | Anxiety: 50%

    Overview...

    8 chances to guess the 4-digit key
    x = digit & its position exact
    y = digit exact, position invalid
    z = digit & position invalid

    Stack...

    8/8 ----
    7/8 ----
    6/8 ----
    5/8 ----
    4/8 xxzx
    3/8 xxzz
    2/8 yxyz
    1/8 zxzz

    Enter your 4-digit key:
    --
    :wq
    Mike Sanders

    --- Synchronet 3.20a-Linux NewsLink 1.114