[Purdue-pm] challenge problem for next meeting?

Mark Senn mark at purdue.edu
Wed Jul 29 07:59:54 PDT 2015


Is there interest in this challenge problem for the next meeting?
Write back if you'll talk, email, or blog about your solution.
Given a list of names, for example
    Abe
    Alan
    Ben
    Cat
    Cathy
print a list of all names, shortening them as much
as possible, with them still remaining unique, like this
    Ab
    Abe
    Al
    Ala
    Alan
    B
    Be
    Ben
    Cat
    Cath
    Cathy
in Perl 5 and Perl 6.

Read the names from a Perl data section one name per line.
Do error checking to make sure you aren't given duplicate names.
Perl 6 has grammars
    http://doc.perl6.org/language/grammars
and sets, bags, and mixes:
    http://doc.perl6.org/language/setbagmix

-mark


More information about the Purdue-pm mailing list