http://www.perlmonks.org?node_id=548829


in reply to Re: Challenge: Hidden Message
in thread Challenge: Hidden Message

diotalevi,
You're probably right about people in general not having a clue as to the right approach without reading the spoilers. I am an avid puzzle and riddle aficionado. One kind of puzzle I see is identifying someone's ATM PIN using a constrained version of this. I incorrectly assumed people who enjoyed my challenges to have the same kind of exposure and recognize it as being similar :-(

The more interesting problem to me is the general case which I am hoping someone provides a better solution then my own.

Thanks for your regex solution. I am not sure I understand it but it gives me something new to work at learning.

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Challenge: Hidden Message
by diotalevi (Canon) on May 11, 2006 at 20:36 UTC

    It's just making a regex like \A[^\n]*(\w)[^\n]*\n(?:[^\n]*\1[^\n]*\n)+\z which just says, I captured $1 and it has to exist on every line. Higher # versions just capture more and assert the new digits, in order. It's really very simple. rx() could be improved if you pegged certain captures with specified characters. I'm searching the entire space so I'm slower.

    What's this have to do with ATM PINs?

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      diotalevi,
      The riddle setup is along the lines that when the website asking for your PIN does so, it will ask for it by creating a larger PIN and place the true values in positions W, X, Y, and Z (which change each time). You are then free to fill all the remaining positions with random numbers. The riddle itself is to determine the PIN after capturing a certain number of succesful logins. Forget I said ATM as this was web banking.

      Cheers - L~R

Re^3: Challenge: Hidden Message
by Unanimous Monk (Sexton) on May 12, 2006 at 18:53 UTC
    You're probably right about people in general not having a clue as to the right approach without reading the spoilers. I am an avid puzzle and riddle aficionado. One kind of puzzle I see is identifying someone's ATM PIN using a constrained version of this. I incorrectly assumed people who enjoyed my challenges to have the same kind of exposure and recognize it as being similar :-(

    Personally, I enjoyed the challenge of trying to figure out what the message was as well as coming up with a general solution (which has now been fixed). I worked out that C,S,0,1,M,E were statistically significant, but I couldn't make heads or tails of what that could possibly mean so I did eventually have to look at the spoilers to work it out.

    I just wish I had more time to spend on things like this instead of doing actual work :)