Skip to content

Commit 4813b79

Browse files
committed
Update README
1 parent f29d592 commit 4813b79

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

README.md

+24-7
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ A simple boolean expression parser written in C#. It parses boolean expressions
2222

2323
## Running
2424

25-
After downloading a release from the Releases section to the right, you can run the program on either Windows or Linux by running `BooleanExpressionParser.exe` or `BooleanExpressionParser` in the terminal respectively. Note, you'll need .NET 6 installed on your machine to run the program.
25+
After downloading a release from the Releases section to the right, you can run the program on either Windows or Linux by running `BooleanExpressionParser.exe` or `BooleanExpressionParser` in the terminal respectively. Note, you'll need .NET 7 installed on your machine to run the program.
2626

2727

2828
## Building
2929

30-
To build the project, you'll need .NET 6 installed. You can then build the project with `dotnet build` or run it with `dotnet run`. Alternatively, you can open the project in Visual Studio or Visual Studio Code, the latter of which has config in the repo.
30+
To build the project, you'll need .NET 7 installed. You can then build the project with `dotnet build` or run it with `dotnet run`. Alternatively, you can open the project in Visual Studio or Visual Studio Code, the latter of which has config in the repo.
3131

3232

3333
## Display
3434

35-
The application displays an intuitive truth table output for each boolean expression:
35+
The application displays an intuitive, coloured truth table output for each boolean expression:
3636
```
3737
┏━━━━━━━━┳━━━━━━━┓ ┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
3838
┃ A B ┃ A.B ┃ ┃ A B C ┃ (!A.B)[XOR]C ┃
@@ -51,7 +51,18 @@ The application displays an intuitive truth table output for each boolean expres
5151

5252
## Usage
5353

54-
Run `./BooleanExpressionParser <args>` from the command line. `args` is a list of boolean expressions to parse. If no arguments are given, the program will prompt you to enter them into the console.
54+
### Truth table generation
55+
`./BooleanExpressionParser table <expression(s)>`
56+
#### Arguments:
57+
- <expression(s)> The boolean expression(s) to evaluate
58+
#### Options:
59+
- -t, --true <true> Character to use for true values in the truth table. [default: 1]
60+
- -f, --false <false> Character to use for false values in the truth table. [default: 0]
61+
62+
More usage options to be implemented in the future.
63+
64+
For help, run `./BooleanExpressionParser --help`. For help with a specific command, run `./BooleanExpressionParser <command> --help`.
65+
5566

5667

5768
## Expressions
@@ -65,15 +76,21 @@ Shown below is a list of supported operators. Each operator's aliases are listed
6576
- NAND
6677
- NOR
6778
- XNOR
79+
- IMPLICATION ('=>')
6880

69-
Of course, you can also use brackets to group expressions. Every type of bracket can be used, which may help distinguish groupings: `()` `[]` `{}` `<>`
81+
Of course, you can also use brackets to group expressions. Every type of bracket can be used, which may help distinguish groupings: `()` `[]` `{}`
7082

7183

7284
## Variables
7385

7486
Any characters in an expression which arent operators or brackets are considered variables. The parser will automatically generate a truth table for each variable. Variables can be several characters long, which allows for numbered variables (`A1`, `A_2`, etc.).
7587

76-
The final truth table is ordered by the order in which the variables are encountered in the expression. For example, the expression `X | A & B` will have the variables ordered `X`, `A`, `B` in the truth table.
88+
To provide an order in which the variables should be printed, give a comma separated list of variables after your expression, separating these parts with a semicolon (`;`). If this isn't given, the truth table is generated in the order the variables are found in the expression.
89+
90+
For example:
91+
- The expression "D0.!S + D1.S" would generate a truth table ordered D0, D1, S.
92+
- The expression "D0.!S + D1.S;S,D0,D1" would generate a truth table ordered S, D0, D1.
93+
7794

7895

7996
## How it works
@@ -116,7 +133,7 @@ The final truth table is ordered by the order in which the variables are encount
116133
- A simple OR gate
117134
- `!S . D_0 + D_1 . S`
118135
- A 2-1 multiplexer
119-
- `(!S0 AND ¬S1 . D0) | (NOT<S0> . S1 . D1) + (S0 . {¬S1 & D2}) OR [S0 . S1 AND D3]`
136+
- `(!S0 AND ¬S1 . D0) | (NOT{S0} . S1 . D1) + (S0 . {¬S1 & D2}) OR [S0 . S1 AND D3]`
120137
- A 4-1 multiplexer, using several aliases for operators and brackets
121138
122139

0 commit comments

Comments
 (0)