fork(9) download
  1. #ruby Mendelbrot 1924-2010
  2. require 'chunky_png'
  3.  
  4. png = ChunkyPNG::Image.new(513, 257, ChunkyPNG::Color::TRANSPARENT)
  5.  
  6. (-128..128).each { |c|
  7. (-256..256).each { |d|
  8. a = b = 0.0
  9. result = (1..70).each_with_index.find {
  10. t = a * b
  11. a *= a
  12. b *= b
  13. a = a - b + d / 256.0 - 0.5;
  14. b = 2 * t + c / 128.0;
  15. a + b > 2 || (a + b).nan?
  16. }
  17. png[d + 256, c + 128] = result ? ChunkyPNG::Color.rgba(0, (result.last * 2.55).to_i, 0, 255) : ChunkyPNG::Color('black')
  18. }
  19. }
  20.  
  21. png.write(STDOUT)
Success #stdin #stdout 14.98s 10400KB
stdin
Standard input is empty
stdout

Standard output is empty