Skip to content

Instantly share code, notes, and snippets.

class SnakePath
def initialize
@paths = Array.new()
end
def add_direction (direction, current_path, south_count, east_count)
south_count = south_count + 1 if direction == 'South'
east_count = east_count + 1 if direction == 'East'
add_direction('South', current_path + "#{direction}, ", south_count, east_count) if south_count < 10