Obfuscation Challenge
From Fmepedia
Challenge
Challenge: Consider this challenge "proof by counter example".
Submit the most compact, awkward, twisted mapping files or workspaces. Browse through them to remind yourself how clarity in your work makes a big difference to others in understanding and modifying what you've started.
100 Bottles of Beer on the Wall
The few lines below are a complete, working mapping file. (Save it in a file called beer.fme and run it!) This example will print out all the lyrics to this popular song in the logfile.
READER_TYPE NULL
WRITER_TYPE NULL
NULL_DATASET BeerOnTheWall
Lookup drink \
1 @Concatenate(@FeatureType(@Concatenate(@GlobalVariable(bottles)," bottle of beer on the wall; ",@GlobalVariable(bottles)," bottle of beer. Take one down and pass it around; No more bottles of beer on the wall.")),@Log(),@GlobalVariable(bottles,0),@FeatureType("Time to buy more beer.")) \
"" @Concatenate(@FeatureType(@Concatenate(@GlobalVariable(bottles)," bottles of beer on the wall; ",@GlobalVariable(bottles)," bottles of beer. Take one down and pass it around; ",@GlobalVariable(bottles,@Evaluate(@GlobalVariable(bottles)-1))," bottles of beer on the wall.")),@Log(),@Lookup(drink,@GlobalVariable(bottles)))
LOG_MAX_FEATURES 1000
FACTORY_DEF * CreationFactory OUTPUT FEATURE_TYPE * @GlobalVariable(bottles,100) @Concatenate(@Lookup(drink,100))
Song Lyric Custom Transformer
I think Kevin wins this challenge, by obfuscating us all. But if you can't beat them, join them. So here is a custom transformer/workspace that uses the new looping technology and published parameters to let you create customized song lyrics. Maybe you'll want to stick to the 'bottles of beer' motif, but my best variations so far have been...
99 FME points in the pipe. 99 FME points. If one of these features should happen to gripe, 98 FME points in the pipe. (Ending with: Oh no! The Unexpected Input Remover!)
99 tickets to do in the queue. 99 tickets to do. If the problem is solved when I give them a clue, 98 tickets to do in the queue. (Ending with: Great - now everyone's happy!)
Of course this is the North American version. I know the British would use "ten green bottles, sitting on the wall". Are there any other international variations on the theme?
Download: songLyricGenerator.fmw
