Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

•Re: Guess the number

by merlyn (Sage)
on Dec 22, 2003 at 17:39 UTC ( #316426=note: print w/replies, xml ) Need Help??

in reply to Guess the number

This looks suspiciously like an answer for an exercise in my Learning Perl. {grin} Good job.

To turn this into a CGI, you have to maintain state between hits. I suggest a server-side database, although an appropriately encrypted hidden field with the right answer and number of guesses so far would also work.

I wrote an article about how to make online quizzes "cheat-proof". Check it out.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://316426]
Tanktalus is trying to figure out how to get a case-insensitive match between straße and strasse to return true in perl :( fc doesn't seem to do it, either, unless I'm doing it wrong.
[LanX]: ß,ss
[LanX]: nope
[LanX]: /.*(?:ß|ss).*/
[hippo]: How are you doing the match? Regex, index, eq or something else?
[choroba]: fc $s1 eq fc $s2 I guess
[Tanktalus]: hippo: I don't care, I just want to prove it can match correctly compared to, say, ILIKE / UPPER / LOWER in postgres :)
[LanX]: is there a unicode convention that ß is ss ?
[Tanktalus]: LanX: yes :) I haven't tried java, but I have this match working in its bastard cousin, C# :) I just thought perl's unicode support would get me there :)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2018-03-21 15:40 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (268 votes). Check out past polls.