sub w{for\$;(1005,924745596,341831533){say map{\$;>>\$_&1?/../?'|':_:\$"}map{\$_+20,\$_,\$_+10}\$_[0]=~/./g}} ##```## # How to find (1005,924745596,341831533) triplet? # use warnings "nmmt"; # Not My Mother Tongue # _ _ _ _ _ _ _ _ <- line1 #| | | _| _||_||_ |_ ||_||_| <- line2 #|_| ||_ _| | _||_| ||_| _| <- line3 # # line 1 (\$l1) is : " _ _ _ _ _ _ _ _ " # 0 1 2 3 4 5 6 7 8 9 # with " "=>0 and "_"=>1, it becomes a binary integer # each digit is encoded with three bits: # 0=> 010 # 1=> 000 # 2=> 010 # ... # 9 (line 3) => 011 (or 0b110 with lower bit at right] # Order of bits is modified to save some bytes (golf-oriented): # in line 1, first and last bits are always zeros (put them at left) # in line 3, there are more zeros for last bit than first bit # This way, the position of 3 bits to encode a digit (abc) # is NOT "0(a),1(b),2(c)" [cba: lower bit right] # # higher lower # 2 1 # 0 0 0 # ... but "20,0,10" (a000000000c000000000b) # ^ ^ ^ # Funny fact: # With the "natural order" the triplet is (1029120,972944241,1069397317) and... # 1069397317 is a prime number http://www.wolframalpha.com/input/?i=1069397317 # and 341831533=577×592429 my \$cl=<\$a"; \$a=0; \$i=0; \$b=20; print "\n"; (\$a+=\$_*2**\$b),\$b=\$b+\$add[\$i++%3] for map{0+(/[|_]/)}split//,\$l2; print "line 2 ->\$a"; \$a=0; \$i=0; \$b=20; print "\n"; (\$a+=\$_*2**\$b),\$b=\$b+\$add[\$i++%3] for map{0+(/[|_]/)}split//,\$l3; print "line 3->\$a"; print "\n"; ```