Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

No bridges please...

by jynx (Priest)
on Feb 27, 2002 at 20:57 UTC ( #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...

Comment on No bridges please...
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
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? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-08-04 00:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (59 votes), past polls