Nov 18th, 2016
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Stack Result in
  2.     Stack={NewStack}
  3.     Result={NewStack}
  4.     for I in {Length L}..1;~1 do
  5.         {Push Stack {Nth L I}}
  6.     end
  7.     for while:{Not {IsEmpty Stack}} do
  8.         local Elt in
  9.             Elt={Pop Stack}
  10.             case Elt of
  11.                '+' then {Push Result {Pop Result}+{Pop Result}}
  12.             [] '*' then {Push Result {Pop Result}*{Pop Result}}
  13.             [] '-' then {Push Result ~{Pop Result}+{Pop Result}}
  14.             [] '/' then
  15.                 local X Y in
  16.                     X={Pop Result}
  17.                     Y={Pop Result}
  18.                     {Push Result Y div X}
  19.                 end
  20.             else {Push Result Elt} end
  21.         end
  22.     end
  23.     {Pop Result}
  24. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.