Saari Development

Ali Rizvi's Technical Blog as a Professional Software Development Engineer

Ruby: Grid Computing Golf

with 2 comments

My first attempt at really playing code golf, that is solving a problem in minimum characters of code and I did not do very well (200 character compared to the best 43 perl or 63 ruby characters).
http://codegolf.com/grid-computing

m = []
r = []
c = Array.new(10, 0)
0.upto(9) {|n|m<Update:
I further squeezed some white-space out of the code and it is starting to look uglier (now it is 184 characters). I am not sure I like the code golf concept although I like to solve coding problems.

m=[]
r=[]
c=Array.new(10,0)
0.upto(9){|n|m<

Advertisements

Written by imsaar

January 8, 2008 at 1:10 am

Posted in code, ruby

2 Responses

Subscribe to comments with RSS.

  1. […] Posted in 1 by Arsalan on January 8th, 2008 This is a variation to the problem/solution posted on Ali Abbas Rizvi’s blog. I wanted to allow the user to enter matrix size for each run and to get a view of a randomly […]

  2. Looks to me like you’ve done a good job with that code. But what do I know? I’m a coding newbie!

    Ashworth Callaway

    January 30, 2008 at 4:59 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: