Skip to content

Commit

Permalink
reversing x dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Warren committed Feb 25, 2011
1 parent 1040555 commit a4f1af4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion string-bitmap.rb
Expand Up @@ -26,7 +26,7 @@
puts data.length.to_s + "," + data[0].length.to_s puts data.length.to_s + "," + data[0].length.to_s
img = Magick::Image.new(data.length, data[0].length) img = Magick::Image.new(data.length, data[0].length)


data.each_with_index do |row, row_index| data.reverse.each_with_index do |row, row_index|
row = row.reverse unless row_index.odd? row = row.reverse unless row_index.odd?
row.each_with_index do |item, column_index| row.each_with_index do |item, column_index|
#puts "setting #{row_index}/#{column_index} to #{item}" #puts "setting #{row_index}/#{column_index} to #{item}"
Expand Down
23 changes: 23 additions & 0 deletions string-generate-test.rb
@@ -0,0 +1,23 @@
require 'rubygems'
require 'RMagick'

f = File.new(ARGV[0], "r")

data = Array.new

max = 0
min = 999

120.times do
data_col = Array.new
if col[0] != 60 # if it's not the line number <#>
# check for trailing comma, remove it:
col = col[0..-4] if col[-3] == 44
col.split(',').each do |cell|
data_col << cell
max = cell.to_f if cell.to_f > max
min = cell.to_f if cell.to_f < min
end
data << data_col
end
end

0 comments on commit a4f1af4

Please sign in to comment.