Name: Anonymous 2012-03-19 0:59
sup /prog/,
I'm doing Python Challenge 7(http://www.pythonchallenge.com/pc/def/oxygen.html), and have it pretty much figured out, however I am having trouble with the RMagick library. I'm an experienced programmer, however I am new to Ruby. There is a hidden message encoded into the image, you can see it, it is the gray strip across the center. Each color corresponds to a hex number, which can be converted to an ascii character. However, when looping through each color, I get a bounds error at pixel 317(on the x axis), when the image is actually 629 pixels wide.
Here's the error I get:
[10challenge7.rb:20:in `get_pixels': geometry (317x47+317+47) exceeds image bounds (RangeError)
from challenge7.rb:20:in `block in <main>'
from challenge7.rb:18:in `each'
from challenge7.rb:18:in `<main>'
Here's my code: http://pastebin.com/CAQs18Ri
Any help is very much appreciated, I just don't understand why it says I'm exceeding the image bounds when I'm not. I'm able to read this much of the hidden message:
smart guy, you made it. the next level is
I'm doing Python Challenge 7(http://www.pythonchallenge.com/pc/def/oxygen.html), and have it pretty much figured out, however I am having trouble with the RMagick library. I'm an experienced programmer, however I am new to Ruby. There is a hidden message encoded into the image, you can see it, it is the gray strip across the center. Each color corresponds to a hex number, which can be converted to an ascii character. However, when looping through each color, I get a bounds error at pixel 317(on the x axis), when the image is actually 629 pixels wide.
Here's the error I get:
[10challenge7.rb:20:in `get_pixels': geometry (317x47+317+47) exceeds image bounds (RangeError)
from challenge7.rb:20:in `block in <main>'
from challenge7.rb:18:in `each'
from challenge7.rb:18:in `<main>'
Here's my code: http://pastebin.com/CAQs18Ri
Any help is very much appreciated, I just don't understand why it says I'm exceeding the image bounds when I'm not. I'm able to read this much of the hidden message:
smart guy, you made it. the next level is