For example, the file#!/usr/bin/perl use strict; use warnings; my @lines; while(<>){ push @lines, $_; } while(@lines){ print flip_line(pop @lines); } sub flip_line {rev_string(join '', map flip_char($_), split //, shift)} sub rev_string {scalar reverse shift} sub flip_char {$_= lc shift; tr/'ahbbmfnnjpdrvutwqgye'/'eyqgwtuvrdpjnnfmbbha'/; $_}
becomessome text can be flipped over using this script
Flipping the text back over can be approximated by something likefdijcs siyf buisn jano paddilt aq uec fxaf awos
This is approximate because of case changes and because the mapping function I use doesn't invert cleanly (since v and u both man to n, for example)../umop-apisdn.pl < test.txt | ./umop-apisdn.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Turning text umop-apisdn
by jwkrahn (Abbot) on Mar 27, 2007 at 09:36 UTC | |
by dewey (Pilgrim) on Mar 27, 2007 at 14:45 UTC | |
by duelafn (Parson) on Mar 27, 2007 at 18:52 UTC | |
by dewey (Pilgrim) on Mar 27, 2007 at 19:40 UTC |