From: gabriele renzi Date: 2002-12-17T05:43:58+09:00 Subject: Re: a range with all the ascii chars On Mon, 16 Dec 2002 23:42:00 +0900, Yohanes Santoso wrote: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >gabriele renzi writes: > > > (0..0xFFFFFF).each{|i| > a = [i>>16&0xFF, i>>8&0xFF, i&0xFF].pack("c*"); > > # Now we test if the packing is right > a.each_byte{|b| print "#{"%02X"%b} "}; puts;} > # And it is, it outputs: > # 00 00 00 > # 00 00 01 > # ...... > # FF FF FE > # FF FF FF >} thanks, hat was interesting too