Skip to content

Instantly share code, notes, and snippets.

@timbuchwaldt
Created May 7, 2011 10:37
Show Gist options
  • Save timbuchwaldt/960398 to your computer and use it in GitHub Desktop.
Save timbuchwaldt/960398 to your computer and use it in GitHub Desktop.
gv.rb
def gv
g = ""
unless @left.nil?
g += @left.gv
g += "\"#{@value}\" -> \"#{@left.value}\";"
end
unless @right.nil?
g += @right.gv
g += "\"#{@value}\" -> \"#{@right.value}\";"
end
if @right.nil? && @left.nil?
return "\"#{@value}\""
end
return g
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment