in reply to Re^3: Perl6 Contest: Test your Skills
in thread Perl6 Contest: Test your Skills

dragonchild,
Right. With all due respect to thor, I believe the original problem was poorly stated (as perhaps was my challenge). I know the ultimate goal was only to determine if such a hand existed, but the process outlined by which to do it was to actually score each hand:

What I want to do is write a program that brute forces the issue. That is to say that I want to create a program that scores all 5-card hands that have a 5 in them and see what happens.

I would prefer that the actual score be tabulated since it is a harder problem, but I am fine with aborting from score() early if you know the score is going to be > 1. This is afterall not about verifying something we already know - it is about exposure to Perl6.

Cheers - L~R

Replies are listed 'Best First'.
Re^5: Perl6 Contest: Test your Skills
by thor (Priest) on May 19, 2005 at 20:13 UTC
    Just as the point of the head post in this thread was to tackle the problem with p6, the point of my initial post was to create a scenario against which I could try creating an iterator. Unfortunately, eveyone got caught up in cribbage semantics. Oh well...I got out of it what I wanted...kind of.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      thor,
      If you would like an explanation of how my iterator works (either the p5 or p6 version), I would be happy to explain. It may not be very clear because I translated a process of doing it by hand on paper to code. There is also the tutorial (How To: Make An Iterator) on building iterators I wrote recently and Roy Johnson's recent Recursively-generated Iterators.

      Cheers - L~R

        What I'm trying to do is the opposite: transform the code in this node and convert it to paper. Of course, I'm trying to do this in spare cycles, so it may not happen overnight. I appreciate the offer. :)

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come