From 6a17551d5cfaec17769c35ec382bbd20949873a1 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Sun, 8 Aug 2021 21:26:25 +0300 Subject: [PATCH] Updated readme: added REPL and errors examples --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 319ce72..e93543e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,31 @@ # Reverse Polish notation calculator in .NET C# -Pass RPN expression as one string as an argument. +Pass RPN expression as one string as an argument or run without arguments for REPL. Calculator also has basic error handler. -## Example +## Examples + +### Argument expression example ```powershell dotnet run "5 3 +" -# >> 8 +8 dotnet run "10 2 - 5 +" -# >> 13 +13 ``` -P.S.I still hate OOP, so code is rather imperative \ No newline at end of file +### REPL examples + +```powershell +dotnet run +>> 5 3 + +8 +>> 10 2 a + +... 2 a + + ^ got unknown operator +>> 10 2 - * 5 + +... 2 - * 5 + ... + ^ operator requires 2 arguments +``` + +P.S.I still hate OOP (don't know it well), so code improvements are welcomed \ No newline at end of file