From 1202ffc8df620945632ba26ba85f7562e7eb0ef6 Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Wed, 1 Apr 2020 14:49:56 +0200 Subject: [PATCH] Add list of boolean operations --- .../docs/language-basics/boolean-if-else.md | 368 ++++++++++++++++++ gitlab-pages/website/static/css/custom.css | 28 ++ 2 files changed, 396 insertions(+) diff --git a/gitlab-pages/docs/language-basics/boolean-if-else.md b/gitlab-pages/docs/language-basics/boolean-if-else.md index 8e35bc2f2..31c87ee4a 100644 --- a/gitlab-pages/docs/language-basics/boolean-if-else.md +++ b/gitlab-pages/docs/language-basics/boolean-if-else.md @@ -36,6 +36,373 @@ let b : bool = false; +Common operations: + + +
+
+ and +
+
+ Logical and +
+
+ +```pascaligo +const logical_and: bool = True and True; +``` + +
+
+ or +
+
+ Logical or +
+
+ +```pascaligo +const logical_or: bool = False or True; +``` + +
+
+ not +
+
+ Logical not +
+
+ +```pascaligo +const logical_not: bool = not False; +``` + +
+
+ = +
+
+ Equals +
+
+ +```pascaligo +const eq: bool = 2 = 3; +``` + +
+
+ =/= +
+
+ Not equals +
+
+ +```pascaligo +const not_eq: bool = 2 =/= 3; +``` + +
+
+ > +
+
+ Greater than +
+
+ +```pascaligo +const gt: bool = 4 > 3; +``` + +
+
+ < +
+
+ Less than +
+
+ +```pascaligo +const lt: bool = 4 < 3; +``` + +
+
+ >= +
+
+ Greater than or equal to +
+
+ +```pascaligo +const gte: bool = 4 >= 3; +``` + +
+
+ <= +
+
+ Less than or equal to +
+
+ +```pascaligo +const lte: bool = 4 <= 3; +``` + +
+
+
+ + +
+
+ && +
+
+ Logical and +
+
+ +```cameligo +let logical_and: bool = true && true +``` + +
+
+ || +
+
+ Logical or +
+
+ +```cameligo +let logical_or: bool = false || true +``` + +
+
+ ! +
+
+ Logical not +
+
+ +```cameligo +let logical_not: bool = not false +``` + +
+
+ = +
+
+ Equals +
+
+ +```cameligo +let eq: bool = 2 = 3 +``` + +
+
+ <> +
+
+ Not equals +
+
+ +```cameligo +let not_eq: bool = 2 <> 3 +``` + +
+
+ > +
+
+ Greater than +
+
+ +```cameligo +let gt: bool = 4 > 3 +``` + +
+
+ < +
+
+ Less than +
+
+ +```cameligo +let lt: bool = 4 < 3 +``` + +
+
+ >= +
+
+ Greater than or equal to +
+
+ +```cameligo +let gte: bool = 4 >= 3 +``` + +
+
+ <= +
+
+ Less than or equal to +
+
+ +```cameligo +let lte: bool = 4 <= 3 +``` + +
+
+
+ + +
+
+ && +
+
+ Logical and +
+
+ +```reasonligo +let logical_and: bool = true && true; +``` + +
+
+ || +
+
+ Logical or +
+
+ +```reasonligo +let logical_or: bool = false || true; +``` + +
+
+ ! +
+
+ Logical not +
+
+ +```reasonligo +let logical_not: bool = !false; +``` + +
+
+ == +
+
+ Equals +
+
+ +```reasonligo +let eq: bool = 2 == 3; +``` + +
+
+ != +
+
+ Not equals +
+
+ +```reasonligo +let not_eq: bool = 2 != 3; +``` + +
+
+ > +
+
+ Greater than +
+
+ +```reasonligo +let gt: bool = 4 > 3; +``` + +
+
+ < +
+
+ Less than +
+
+ +```reasonligo +let lt: bool = 4 < 3; +``` + +
+
+ >= +
+
+ Greater than or equal to +
+
+ +```reasonligo +let gte: bool = 4 >= 3; +``` + +
+
+ <= +
+
+ Less than or equal to +
+
+ +```reasonligo +let lte: bool = 4 <= 3; +``` + +
+
+
## Comparing Values @@ -152,6 +519,7 @@ let c : bool = (a = b) // false + ```reasonligo group=d let a : tez = 5mutez; let b : tez = 10mutez; diff --git a/gitlab-pages/website/static/css/custom.css b/gitlab-pages/website/static/css/custom.css index 476f1da98..6d2e05fec 100644 --- a/gitlab-pages/website/static/css/custom.css +++ b/gitlab-pages/website/static/css/custom.css @@ -1029,3 +1029,31 @@ a:hover { background-color: transparent; } +.boolean-example-table { + display: grid; + grid-template-columns: 10% 30% 60%; + width: 100%; +} + +.boolean-example-table .operation{ + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; +} + +.boolean-example-table .description { + display: flex; + align-items: center; +} + +.boolean-example-table > div:nth-child(6n+1), +.boolean-example-table > div:nth-child(6n+2), +.boolean-example-table > div:nth-child(6n+3) { + background-color: var(--ifm-table-stripe-background); +} + +.boolean-example-table > .example pre, +.boolean-example-table > .example .codeBlockLines_src-theme-CodeBlock- { + background-color: transparent; +} \ No newline at end of file