Ruby wrapper for aalib. Like the awesome aalib-ruby but doesn't require you to have aalib installed.
Add this line to your application's Gemfile:
gem 'aalib', :github => 'elbongurk/aalib'
And then execute:
$ bundle
width, height = [300, 200]
a = AAlib::Context.new(width, height)
height.times do |y|
width.times do |x|
# Greyscale values go in from 0-255
a.putpixel(x, y, Random.rand(256))
end
end
# Compute!
a.render
# scrheight & scrwidth are 50% size of height & width
a.scrheight.times do |y|
a.scrwidth.times do |x|
# Retrieve ASCII character value
a.getpixel(x, y)
# Retrieve aalib attribute value
a.getattr(x, y)
# Retrieve greyscale color value
a.getcolor(x, y)
end
end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request