r=*\$<;'XXXXXXXXXXXX'.each_byte{|i|\$><<"%#{327%i/9}c"% 'ohmx'[1>>(i-r.to_i)%12^2&2<```## 1>>(i-r.to_i)%12^2&2<## 1>>(i-h)%12^2&2<## # Search for Ruby solutions by building expressions from the sym # and numsymop arrays below, then evaluating them (via eval). # 0, 11, 1, 10, 2, 9, 3, 8, 4, 7, 5, 6 i_arr = [ 120, 47, 253, 22, 194, 21, 183, 44, 196, 55, 125, 246 ] sym = [ '*', '/', '%', '+', '-', '>>', '<<', '&', '^', '|' ] numsymop = (-12..12).to_a numsymop.unshift('i'); numsymop.unshift('-i'); numsymop.unshift('~i') numsymop.unshift('m'); numsymop.unshift('-m'); numsymop.unshift('~m') for op2 in numsymop for s2 in sym \$stderr.print "#{op2} #{s2}\n" for op3 in numsymop for s3 in sym for op4 in numsymop for s4 in sym for op5 in numsymop expr = op2.to_s + s2 + op3.to_s + s3 + op4.to_s + s4 + op5.to_s i = 120; m = 0 # (d = 0) c_expr = "i=#{i};m=#{m};" + expr veq1 = -4242 begin veq1 = eval(c_expr) rescue end next if veq1 == -4242 i = 47; m = 11 # (d = 11) c_expr = "i=#{i};m=#{m};" + expr veq2 = -4242 begin veq2 = eval(c_expr) rescue end next if veq2 == -4242 next if veq1 != veq2 i = 120; m = 11 # (d = 0) c_expr = "i=#{i};m=#{m};" + expr vneq1 = -4242 begin vneq1 = eval(c_expr) rescue end next if vneq1 == -4242 next if vneq1 == veq1 i = 47; m = 10 # (d = 11) c_expr = "i=#{i};m=#{m};" + expr vneq2 = -4242 begin vneq2 = eval(c_expr) rescue end next if vneq2 == -4242 next if vneq1 != vneq2 good = 1 for i in i_arr d = i % 12 m = d c_expr = "i=#{i};m=#{m};" + expr veq2 = -4242 begin veq2 = eval(c_expr) rescue end if veq2 == -4242 good = 0 break end if veq1 != veq2 good = 0 break end end next if good == 0 for i in i_arr d = i % 12 for m in 0..11 next if m == d c_expr = "i=#{i};m=#{m};" + expr vneq2 = -4242 begin vneq2 = eval(c_expr) rescue end if vneq2 == -4242 good = 0 break end if vneq1 != vneq2 good = 0 break end end break if good == 0 end next if good == 0 print "woohoo: #{expr}: veq=#{veq1} vneq=#{vneq1}\n" \$stdout.flush end end end end end end end #### woohoo: ~m%i%12/11: veq=1 vneq=0 #### (i-h)%12/~i #### 1>>(i-h)%12^2&2<## r=*\$<;'XXXXXXXXXXXX'.each_byte{|i|\$><<"%#{327%i/9}c"% 'hxmo'[(i-r.to_i)%12/~i^~r[3,2].to_i/5%i%12/11]+\$/*(i/85)} #### r=*\$<; r r[3,2] # original gets;~/:/; \$_ \$' # new #### gets;'XXXXXXXXXXXX'.each_byte{|i|\$><<"%#{327%i/9}c"%'ohmx'[1>>(i-\$_.to_i)%12^~/:/&2<## (i-int(r[:2]))%-12/42 #### (i-int(r[:2]))%-12/i #### _=raw_input() for c in'XXXXXXXXXXXX':n=ord(c);print 3459%n/9*' '+'ohmx'[n%13==int(_[:2])%12::2][n%13==int(_[3:])/5]+n%3*'\n', #### _=raw_input() for c in'XXXXXXXXXXXX':n=ord(c);print 247%n/7*' '+'ohmx'[n%12==int(_[:2])%12::2][n%12==int(_[3:])/5]+n/72*'\n', #### [(i%12==int(r[3:])/5)^(i-int(r[:2]))%-12/42] [-(i%12==int(r[3:])/5)^1>>(i-int(r[:2]))%12] [i%12==int(r[3:])/5::2][i%12==int(r[:2])%12] [i%12==int(r[3:])/5::2][1>>(i-int(r[:2]))%12] ```