Logo
  • Features
  • Educators
  • What's New
  • Blog
  • Showcase
  • About us
  • Contact
Try it now!
Syntactic Sugar
Syntactic Sugar

Syntactic Sugar

What is Syntactic Sugar?

In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It’s like a “shortcut” provided by the language that makes the language “sweeter” for human to use.

Gandi IDE introduces some syntactic sugar blocks to Scratch.

Modules

Module
Description
Mathematics
- Some mathematical operators that are not supported by Scratch.
String
- Advanced operations on strings.
Utils
- Extended possibilities.

Functions and Definitions

Mathematics

Calculate the base raised to the power of the exponent.

image
Input
Description
Example Value
base
The base in exponentiation.
2
exponent
The exponent in exponentiation.
10

Coding with basic blocks

image

Coding with sugar blocks

image

Check if a value is greater/less than or equal to another value.

image
image

Coding with basic blocks

image
image

Coding with sugar blocks

image
image

String

Return different values determined by the result of the condition.

image

Coding with basic blocks

image

Coding with sugar blocks

image

Return a part of a string.

image

Coding with basic blocks

image

Coding with sugar blocks

image

Split a string with another string and return one of the results.

image
Input
Description
Example Value
original string
The original string which needs to be split.
The quick brown fox jumps over the lazy dog.
string
The string used to split the original string.
jumps over
item number
The number of items to be returned.
1
Selection
Description
return value
When the item number is out of range, what value will be returned? There are three options: - the last string: Return the last item after splitting. - an empty string: Return an empty string. - false: Return false.

Coding with basic blocks

image

Coding with sugar blocks

image

Utils

Customize an event that will be dispatched by a condition. The input should be a boolean block.

image

Copy a string to the clipboard.

image

Change Logs

💡
If you have any questions or suggestions, find us on the discord channel: https://discord.gg/U3nyveCvRa
Logo

Designed by 2ndR with love

Discord