Shunting-Yard Animation

(somethingorotherwhatever.com)

20 points | by s1291 2 hours ago

3 comments

  • alter_igel 6 minutes ago
    I'm not familiar with the algorithm and I don't see much explanation on the site (at least on mobile) but AFAICT this is turning parenthesized infix expressions into reverse Polish notation. In other words, it takes human-readable mathematical formulas and converts them into something a simple stack-based machine can compute in one forward pass.

    It also appears that separate digits aren't interpreted as decimal numerals (i.e. (1)(3) is the sequence 1,3 and not 13) which can look a bit misleading.

  • dcrazy 35 minutes ago
    I typed `100+88/4` and the resulting output was `100884+/`. Should the algorithm be inserting a symbol to delineate operands?
  • IIAOPSW 39 minutes ago
    Hold up. you can't just have the train take the parenthesis off screen and hand wave away what happens to those cars. What happens when your forced to keep the garbage of a computation because you can't delete anything?

    (https://en.wikipedia.org/wiki/Reversible_computing)