Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

No bridges please...

by jynx (Priest)
on Feb 27, 2002 at 20:57 UTC ( [id://148037]=obfuscated: print w/replies, xml ) Need Help??


Sadly,

This japh isn't as robust as my original plans, but it does fit on the four lines that is recommended. The full version takes data from a file and performs checks on that, which is much more interesting. Oh well. here it is:

#!/usr/bin/perl -w use strict; $;='|';@_=(0,0);@;=map[split/,/],split/;/,"',106,0,0,1;1,',0,1,0;0,0 ,',1,1;0,97,112,',0;1,0,104,0,'";{$;[$_[0]][$_[1]]=~/[1-9]/?($;{$_[ $;eq'|']}++&&last,$;=$;eq'-'?'|':'-',$_{$;[$_[0]][$_[1]]}++,($_[$;eq '|']+=1)%=@;):(($_[$;eq'|']+=1)%=@;);redo}print chr for reverse keys%_
enjoy,
jynx

update: one of these days i'm going to finish something before i post it. *sigh*, maybe. oh well, here's an updated version, a bit more interesting i think...

#!/usr/bin/perl use strict; @;=map[split/,/],split/;/,<DATA>;--$|;{$;[$_[0]][$_[1]]=~ /[1-9]/?($;{$_[$|--]}++&&last,$_{$;[$_[0]][$_[1]]}++):8,( $_[$|]+=1)%=@;;redo}print chr for reverse 10,keys%_ __END__ ',106,0,0,88;4,',0,7,0;0,0,',12,94;0,97,112,',0;5,0,104,0,'
nuf evah...

update2: d'oh! This seems to have been broken on perl 5.8. i tested multiple platforms with perl 5.6 and it seemed to work correctly (otherwise i wouldn't have posted it at all). Hmm, if i get time i'll reply to this post with an updated version that works... *sigh*, one of these days...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://148037]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found