For a laugh I tried porting it to C using ruby inline. luke_bkk 21st October, 2008 15:21 (UTC)
Only to discover C sucks. Due to the limits of the data structure I could only go to 17x17 grid. Still it runs like shit off a stick (1.5e-05s whatever that means). Any idea how you would deal with big numbers.
For a laugh I tried porting it to C using ruby inline. Kirit Sælensminde 21st October, 2008 17:16 (UTC)
luke_bkk said

Only to discover C sucks. Due to the limits of the data structure I could only go to 17x17 grid. Still it runs like shit off a stick (1.5e-05s whatever that means). Any idea how you would deal with big numbers.

I'm using a 64 bit unsigned integer type for mine (if you're using gcc try uint64_t). You might be interested (or surprised?) to know that my C++ is basically the same line count as your Ruby — 15 lines.


To join in the discussion you should register or log in