diff --git a/docs/blocks/conditionals.md b/docs/blocks/conditionals.md new file mode 100644 index 0000000..2c0c360 --- /dev/null +++ b/docs/blocks/conditionals.md @@ -0,0 +1,16 @@ +--- +title: Conditionals +sidebar_position: 1 +--- + +# Conditionals +:::warning +These docs are not completely finished yet. We're slowly working on expanding the documentation while we work on other things, so please be patient with us! +::: + +The conditional blocks consist of the following blockset: +Conditionals Blockset + +These blocks are probably familiar to most people. But if you're not, that's why you came here, isn't it? They return true or false. + +First off, the = and ≠ blocks. = means equals, and ≠ means not equals. Simple, isn't it? There's also < and >. < means less than, so `42 < 50` would return true, but `50 < 42` would return false. Other way around for >. Then, ≤ and ≥. ≤ means less than or equals to, and ≥ means greater than or equals to. \ No newline at end of file diff --git a/docs/blocks/index.md b/docs/blocks/index.md index 6185170..e86498b 100644 --- a/docs/blocks/index.md +++ b/docs/blocks/index.md @@ -11,4 +11,5 @@ Need help figuring out a set of blocks or category in PenguinMod? Heres a list of Blocks we have covered at the moment: - [Switch Case](./switch-case) -- [Username Blocks](../username) \ No newline at end of file +- [Username Blocks](../username) +- [Conditionals](./conditionals) \ No newline at end of file diff --git a/docs/blocks/switch-case.md b/docs/blocks/switch-case.md index 693fdbe..84a5c85 100644 --- a/docs/blocks/switch-case.md +++ b/docs/blocks/switch-case.md @@ -9,4 +9,12 @@ These docs are not completely finished yet. We're slowly working on expanding th ::: The Switch Case blocks consist of the following blockset: -Switch case Blockset \ No newline at end of file +Switch case Blockset + +The Switch Case blocks are simple once you learn them. This page should *hopefully* help with that. The `switch` block is where all the cases are housed. Think of it like a really long `if`/`else` chain, except easier to work with. The `default` variant can be thought of as a final `else` statement. The empty input is where you put in what is to be checked, such as a variable. + +The `case` blocks themselves are also simple. You put them together inside a `switch` block and then the code you want to run inside. The input in the top is where you put what needs to be checked, see above. It can be anything, even a string! + +The `run next case when` block is used for running the next case when the condition is true. I think. *frankly i havent used that block ever sorry* + +And finally, the `exit case` block. This is similar to `break` in many other languages. It exits the Switch Case and cannot be used outside of a case. It throws an error when attempting to do so. \ No newline at end of file diff --git a/static/img/conditionals.png b/static/img/conditionals.png new file mode 100644 index 0000000..2cf5595 Binary files /dev/null and b/static/img/conditionals.png differ