Code Blocks
An app is simply a sequence of events. The best apps define an elegant sequence of events that happen without the user even noticing. A great sign in flow for example can happen in seconds but the logic and sequence behind them is a work of art that has been iterated on many times.
This is where Thunkable Blocks come in. Thunkable Blocks are the building blocks of a great experience for your app users. Every component has its own set of blocks to start or trigger an event and set and change properties. They can be connected to a commonly used set of blocks that range from opening screens, setting up logic, reformatting data or simplifying code.
Regardless of the programming language, the logic behind an algorithm (the steps needed to perform the task of a program or application) is the same and it usually consists in some basic programming concepts. Here are some examples.
Conditions
In most apps, one event leads to another event if a condition is met. To specify these scenarios, the if this, do that block is commonly used with Logic blocks that define the conditions that lead one event to the next. The if this, do that block can be transformed to support more complex logic:
![](https://huge.academy/pluginfile.php/4547/mod_page/content/6/05-if-this-do-that.png)
Loops
Loops are used to repeat a set of blocks for a specified amount of times (see Button1 below), for an unlimited period of time (see Button5 below), or for a specified number of times (see Button2, Button3, and Button4).
![](https://huge.academy/pluginfile.php/4547/mod_page/content/6/06-loops.png)
Logic
Condition blocks are always paired with statement blocks that test whether a condition is met. Sometimes, loops also need logic blocks (see Button4 above). The comparison blocks will compare two values and return true or false based on whether the condition is met (see Button4 and Button5 above).
You can compare multiple conditions at once. The and block will return true if both statements are true, false otherwise. The or block will return true if either statement is true, and false if neither statement is true.
Other Blocks
While all the above are the founding blocks for any algorithm, there are tons of other commands available. Most of them are specific to app-building. Here is the full list (external link to Thunkable Docs).