In data 27 mai 2009 alle ore 23:46:40, John M. Dlugosz <2nb81l...@sneakemail.com> ha scritto:

Anything in the existing implementation that's hostile to Perl 6? Just port it over by lightly editing the text or using a p5 module importer.

Yes, right, but that wouldn't use Perl 6 features.

To write from scratch, I suppose it's just a recursive function that talks and drinks beer.

About the beer drinking, that's one of the main points :)
I think the interesting part is when you want to see it
from the "real-world game" point of view, so in this case,
writing a function that returns the next correct word.

In the Perl 5 solution, I wrote a function that
allows you to do this:

   # Up to any number of "repeats"
   my $iter = bon_digi_sequence(5);
   while (my $word = $iter->()) {
       print $word, ' ';
   }

I'm not saying it's difficult, of course.

To me it's interesting to know from others (because
I don't know) how would you go writing this function
with the weapons Perl 6 gives you.

--
Cosimo

Reply via email to