Skip to content

Instantly share code, notes, and snippets.

@nikasulo
Created August 29, 2019 12:33
Show Gist options
  • Save nikasulo/77192c651ebaac2923c1df981ab5f626 to your computer and use it in GitHub Desktop.
Save nikasulo/77192c651ebaac2923c1df981ab5f626 to your computer and use it in GitHub Desktop.
Switch statement
if string[i] == '}' || ')' || ']'
case string[i]
when "]"
if s.topFront == "["
s.popFront
else
return false
end
when ")"
if s.topFront == "("
s.popFront
else
return false
end
when "}"
if s.topFront == "{"
s.popFront
else
return false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment