Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/blocks/conditionals.md
Original file line number Diff line number Diff line change
@@ -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:
<img src="/img/docimages/conditionals.png" alt="Conditionals Blockset"></img>

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.
3 changes: 2 additions & 1 deletion docs/blocks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- [Username Blocks](../username)
- [Conditionals](./conditionals)
10 changes: 9 additions & 1 deletion docs/blocks/switch-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<img src="/img/docimages/switchcase.png" alt="Switch case Blockset"></img>
<img src="/img/docimages/switchcase.png" alt="Switch case Blockset"></img>

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.
Binary file added static/img/conditionals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading