RosettaCodeData/Task/Last-letter-first-letter/00-TASK.txt

34 lines
1.5 KiB
Plaintext

A certain children's game involves starting with a word in a particular category.   Each participant in turn says a word, but that word must begin with the final letter of the previous word.   Once a word has been given, it cannot be repeated.   If an opponent cannot give a word in the category, they fall out of the game.
For example, with   "animals"   as the category,
<pre>
Child 1: dog
Child 2: goldfish
Child 1: hippopotamus
Child 2: snake
...
</pre>
;Task:
Take the following selection of 70 English Pokemon names &nbsp; (extracted from &nbsp; [[wp:List of Pokémon|Wikipedia's list of Pokemon]]) &nbsp; and generate the/a sequence with the highest possible number of Pokemon names where the subsequent name starts with the final letter of the preceding name.
No Pokemon name is to be repeated.
<pre>
audino bagon baltoy banette bidoof braviary bronzor carracosta charmeleon
cresselia croagunk darmanitan deino emboar emolga exeggcute gabite
girafarig gulpin haxorus heatmor heatran ivysaur jellicent jumpluff kangaskhan
kricketune landorus ledyba loudred lumineon lunatone machamp magnezone mamoswine
nosepass petilil pidgeotto pikachu pinsir poliwrath poochyena porygon2
porygonz registeel relicanth remoraid rufflet sableye scolipede scrafty seaking
sealeo silcoon simisear snivy snorlax spoink starly tirtouga trapinch treecko
tyrogue vigoroth vulpix wailord wartortle whismur wingull yamask
</pre>
Extra brownie points for dealing with the full list of &nbsp; 646 &nbsp; names.
<br><br>