Think of a similar thing and see how it applies for example, language: it seems like a good first step would be to figure out the important bits of communication, like 'help', 'yes', 'no', etc - use your own language to figure out some important things you've got to say. Then, you know how to say 'banana me', so you need to figure out how to 'do things right'. An example of this would be going from 'banana need' to 'I need banana'; so you have to figure out some bits of grammar. From some bits of grammar, you need to start expanding your vocabulary - learn to talk about things you're interested in, then start to read and speak about these things. Pick up common idioms as you go. Finally, work on perfecting your grammar. You should already have a decent grasp of it, but now you can dig the nuances out and make them flow in your speech. Actively seek editorial advice; write in your new language. Then just use, use use. -------------- 458 458 div 16 = 28 2 * 16**2 + 8 * 16**1 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 A 10 B 11 C 12 D 13 E 14 F 15 200 / 16 = 12.5 FFF = 16 ** 3 * 15 + 16 ** 2 * 15 + 16 ** 1 * 15 12.5 = C8 28 / 16 = 1.75 1CA def to_h num / 16 = new_num if new_num < 16 then string.append(new_num.char) else string.append(num - (new_num * 16).char) num = new_num end end def to_h(num) str = "" while num > 0 do new_num = num / 16 if new_num < 16 then str = str + hexify(new_num) else str = str + hexify((num - (new_num * 16)) num = new_num end end end def hexify(num) str = "" if num < 16 then convert(num) else str += hexify(num/16).to_s str += to_h(num - (num/16 * 16)) end end class Fixnum # Evil monkey patching! # this adds "to_hex" to Fixnums, allowing you to convert any Fixnum to its hexadecimal representation. def convert_small_hex(num) if num.class == Fixnum then if num < 0 or num > 15 then "error" elsif num <= 9 then num.to_s else (num+87).chr end end end def to_hex(num) str = "" if num < 16 then convert_small_hex(num) else str += hexify(num/16).to_s str += convert_small_hex(num - (num/16 * 16)) end end end class Fixnum # Evil monkey patching! def convert_small_hex(num) if num.class == Fixnum then if num < 0 or num > 15 then "error" elsif num <= 9 then num.to_s else (num+87).chr end end end def to_hex(num=self) str = "" if num < 16 then convert_small_hex(num) else str += to_hex(num/16).to_s str += convert_small_hex(num - (num/16 * 16)) end end end 458 458 > 0, so 458 / 16 = 12 12 < 16, so str += hexify(12) num = 458 - 12 * 16 class Fixnum # Evil monkey patching! def convert_small_hex(num) if num.class == Fixnum then if num < 0 or num > 15 then "error" elsif num <= 9 then num.to_s else (num+87).chr end end end def to_hex(num=self) str = "" if num < 16 then convert_small_hex(num) else str += to_hex(num/16).to_s str += convert_small_hex(num - (num/16 * 16)) end end end bmp = open("test.bmp", "rb") arr = [] i = 0 bmp.each_byte do |byte| arr[i] = byte i += 1 end bmp.close arr.each_with_index do |thing, index| arr[index] = arr[index].to_hex end