Ruby, Ruby on Rails, Artificial Intelligence and something more ...

Ver y Cocinar, descubre la cocina y disfrĂștala a simple vista

RailsConf Europe 2007 Speaker

RailsConf Europe 2007 Speaker

Spejman Thumblog!

Tuesday, 5 June 2007

Draw with Ruby and Scribble!

Looking at the new blog of _why ( I found Scribble! that it's a Ruby version of NodeBox. Its aim is to make cool graphics using Ruby.

If you want to test it using windows, you can follow the instructions at

I wanted to test it in Linux but I didn't found related information, then I did some research on how to install it. Finally, I made it work in Ubuntu following these steps:

  1. Install cairo and gtk2 ruby libraries and get the scribble code:

    sudo apt-get install libcairo-ruby1.8 libgtk2-ruby
    svn co svn:// scribble

  2. Execute scribble:

    cd scribble

With these steps we'll execute Scribble! and we can do graphs like this:

Scribble! Screenshot

This drawing is uniq because it is randomly generated from this code:

brush.fill = rand(0.1) + 0.9, rand(0.4) + 0.6, rand(0.1) + 0.9, rand(0.1)+0.1

brush.fill = rand(0.1) + 0.9, rand(0.4) + 0.6, rand(0.1) + 0.9, rand(0.1)+0.1
brush.stroke = rand(0.4) + 0.6, 0, 1, 0.2
brush.width = 2

100.times do
circle :center => [rand(size[0]), rand(size[1])], :radius => rand(50) + 10

If you like Scribble! and make some cool graphics, share it putting its code as a comment in this post ;)

No comments:

About Me

Barcelona, Barcelona, Spain