Skip to content

Commit

Permalink
minor formatting nit
Browse files Browse the repository at this point in the history
just a minor formatting nit from previous commit
  • Loading branch information
Humblemonk committed Jun 19, 2024
1 parent 5c997d1 commit 6bbeba6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dice_maiden_logic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def convert_input_to_rpn_queue(event, input)

output_queue = []
operator_stack = []

# Use the shunting yard algorithm to get our order of operations right
while input_queue.length > 0
input_queue_peek = input_queue.last
Expand Down Expand Up @@ -187,11 +188,13 @@ def convert_input_to_rpn_queue(event, input)
raise "Invalid token! (#{input_queue_peek})"
end
end

while operator_stack.length > 0
raise "Extra '(' found!" if operator_stack.last == '('

output_queue.prepend(operator_stack.pop)
end

output_queue
end

Expand Down

0 comments on commit 6bbeba6

Please sign in to comment.