Friday, September 28, 2007

The ruby code for unearthing vista multiplication(display) bug

is this
counter=0;total=0;
1.step(65535,0.1){|x| total+=1; y=((65535/x).to_s).delete('.').split(//).last; if(y.to_i==5 or y.to_i==0); counter+=1; puts "#{65535/x},#{x}-#{65535/x*x}"; end


I love ruby :)

Actually this code spits out 72000 such numbers however the bug is present in around 12000 such numbers. Seems my pattern is only 1/6 true :)

No comments: