adamcrussell

Perl Fun

This week's Perl Weekly Challenge seems to be on the lighter and more fun side. Part One was to do a "Square Secret Code" and Part Two was to do a quine.

Part 1

The Problem

The square secret code mechanism first removes any space from the original message. Then it lays down the message in a row of 8 columns. The coded message is then obtained by reading down the columns going left to right.

For example, the message is “The quick brown fox jumps over the lazy dog”.

Then the message would be laid out as below:

tbjrd hruto eomhg qwpe unsl ifoa covz kxey

What I Did

Sample Run

$ perl perl/ch-1.pl "The quick brown fox jumps over the lazy dog"
tbjrd hruto eomhg qwpe unsl ifoa covz kxey 


Part 2

The Problem

Write a script that dumps its own source code. 

What I Did

Sample Run

$ perl perl/ch-2.pl
print<<''x2,"\n"
print<<''x2,"\n"

$ perl perl/ch-2.pl | diff - perl/ch-2.pl
$



Comments for this post were locked by the author