Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

No bridges please...

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


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%_

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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2019-06-15 22:56 GMT
Find Nodes?
    Voting Booth?
    Is there a future for codeless software?

    Results (76 votes). Check out past polls.