Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^5: Shuffling cards

by blazar (Canon)
on Feb 24, 2005 at 09:16 UTC ( #433988=note: print w/replies, xml ) Need Help??

in reply to Re^4: Shuffling cards
in thread Shuffling cards

And then you didn't fix the other \d. Now it still fails on "10b".
But then the rules explicitly state that "any numbers will be between 2 and 9 inclusive".
Yes, I know the rules are for people who can't program and uses arbitrary limits to allow even the most sloppy coders to score a few marks. But that's no excuse for code on perlmonks, is it? ;-)
Personally I do not share this somewhat elitarist attitude. (Hey, at least that's how I perceive it to be!)

Also, one should take into account that not everybody is so lucky as to use perl, as we do! I don't dare to imagine how damned complicate it would be to do this, say, in C... (well, it would, for me!)

Last, I think that it was important to give the OP an answer to what he asked for, i.e. a solution to the proposed problem. Please note, in particular, that I clearly wrote: "sample code to solve the assignment". But of course on PM it's fine to give solutions that also do more than that...

Replies are listed 'Best First'.
Re^6: Shuffling cards
by Anonymous Monk on Feb 24, 2005 at 11:07 UTC
    I don't dare to imagine how damned complicate it would be to do this, say, in C.
    It would be more work in C. I fail to see that a solution in C would be simpler if one can assume the numbers are smaller than 10, or that the string is limited to 20 characters.
    Personally I do not share this somewhat elitarist attitude.
    Well, I think there's no excuse for sloppy code at all. Not on Perl monks, and not outside Perl monks either.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://433988]
[Corion]: Your Mother: I think that's because (in the west) the Nazi-Germans are recognized as universally evil. Of course, you could do some number games to calculate other measures of evil than "historic losers of second world war" to come up with other evils:)
[Corion]: I've heard "Troll" described as the new Punk, and in a way, it can be as destructive as living the Punk lifestyle, and you don't have to sit out in the cold...
[LanX]: Anti-Germans
[LanX]: Socrates was a Troll
[Your Mother]: It's very, very dangerous... Thinking that a group is intrinsically evil... buries the fact that all humans can be so deep that it starts to become likely they will be.
[Your Mother]: LanX++
[Corion]: (also the "troll for trolls sake" could seen be much like the "punk for punks beer")
[Your Mother]: I'm completely (historically anyway) a troll in real life. It's not fun online, you can't really win. :P
Happy-the-monk orders a Punk IPA.
[Your Mother]: Also, I'm too old to start fights with strangers anymore.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (16)
As of 2018-03-19 13:45 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.