okay, so lets print the thing in a square, and make it readable in several directions (theoretically)
#!/usr/bin/perl -w use strict; print 'What string would you like to twiddle? '; chomp(my $twiddle = <STDIN>); my $string; my $oldString = ""; my $totallen = length($twiddle); my @t = split(//, $twiddle); for (0..$#t) { $string = shift(@t); print $oldString; for(my $i = 0; $i < (2*($totallen - length($oldString))-1); $i++) { print $string; } print (scalar reverse $oldString); print "\n"; # up $oldString .=$string; } while ($oldString) { chop($oldString); $string = substr($oldString, (length($oldString)-1)); print $oldString; # print the first part o' the string (minus the +last character) for(my $i = 0; $i < (2*($totallen - length($oldString))-1); $i++) { print $string; #print each 'last' character up there enough ti +mes to make the square } print (scalar reverse $oldString);# print the last part o' the str +ing (minus the first character) print "\n"; }
hhhhhhhhh
heeeeeeeh
hellllleh
hellllleh
hellolleh
hellllleh
hellllleh
heeeeeeeh
hhhhhhhhh
I know the code is hacky, but it works...
_________________________________________
E-Bitch
Tempora Mutantur Nos et Mutamur in Illis
"The Times are Changed Even as We are Changed in Them"

In reply to 360 degree Twiddle (Re: Twiddle) by E-Bitch
in thread Twiddle by Siggy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.