Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
DovahBot authored Nov 30, 2022
1 parent 1e1d1f1 commit eed2b10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions InfixToPostfix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The following Piet program resembles the [Shunting Yard Algorithm](https://en.wi

## Program Map
> Use this to follow the explanation below
![](/InfixToPostfix/infixToPostfix_Eval.png)

## Explanation
Expand All @@ -19,7 +20,7 @@ The following Piet program resembles the [Shunting Yard Algorithm](https://en.wi
- 2a - Ensures CC is set to left
3. Push 48 (0) to stack to check if **token** is a digit or operator
4. If **token** is an operator (or parenthesis) go to <span style="color:red">red</span>
5. Else input char is a digit, so output the number and loop back to <span style="color:cyan">blue 2</span>
5. Else **token** is a digit, so output the number and loop back to <span style="color:cyan">blue 2</span>

### <span style="color:red">Parenthesis Check (Red)</span>
1. Push 40 ('(') onto the stack, if **token** is left paren go to <span style="color:red">red 1a</span>
Expand Down Expand Up @@ -67,4 +68,4 @@ The following Piet program resembles the [Shunting Yard Algorithm](https://en.wi
- 4a - Correct CC and go back to <span style="color:lime">green 2</span>

## Limitations
Does not handle multi-digit numbers, negative numbers, or exponents in input.
Does not handle multi-digit numbers, negative numbers, or exponents in input.

0 comments on commit eed2b10

Please sign in to comment.