Python to Ruby
Convert this Python code to Ruby. NOTE: This program likely won't run.
Start file
class PythonToRuby: def add(x, y): x + y n = add(1 + 1)
End file
class PythonToRuby def add(x, y) x + y end n = add(1, 2) end
View Diff
1,3c1,4 < class PythonToRuby: < def add(x, y): < x + y --- > class PythonToRuby > def add(x, y) > x + y > end 5c6,7 < n = add(1 + 1) --- > n = add(1, 2) > end
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 60 remaining solutions by signing in and submitting your own entry
#61 Brandon Lee / @bernardoodoo - Score: 67 - 10/24/12 @ 14:11
$xjxjo<BS><BS>end<Esc>/+<CR>nnhxr,ll<C-A>o<BS><BS>end<C-C><C-C>:<Up>s<BS>$<BS>%s/^\<BS>\s<BS><BS> <BS><BS>\ <BS><BS> /\t/g<CR>:wq<CR>
0 comments