programming
Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
Próxima revisão | Revisão anterior | ||
programming [2025/07/18 20:35] – criada admin | programming [2025/07/18 20:37] (atual) – [Difficulty Hierarchy] admin | ||
---|---|---|---|
Linha 1: | Linha 1: | ||
- | ``` | ||
====== Programming ====== | ====== Programming ====== | ||
Linha 17: | Linha 16: | ||
- Import / Export program files. | - Import / Export program files. | ||
- | {{:programming.png|Programming Menu}} | + | {{:programacao.png|Programming Menu}} |
> **Tip!** If your written program (not BlockEduc) becomes too large (+700 lines), we recommend using VSCode to program in the simulator. Simply look for the " | > **Tip!** If your written program (not BlockEduc) becomes too large (+700 lines), we recommend using VSCode to program in the simulator. Simply look for the " | ||
Linha 25: | Linha 24: | ||
{{ switch_language.png? | {{ switch_language.png? | ||
That is, given the hierarchy below: | That is, given the hierarchy below: | ||
- | - [[BlockEduc]] (Easiest) | + | - [[en:BlockEduc]] (Easiest) |
- | - [[rEduc]] (Intermediate) | + | - [[en:rEduc]] (Intermediate) |
- | - [[csharp|C# | + | - [[en:csharp|C#]] (Most difficult) |
It is always possible, by programming in an easier language, to convert your code to a more difficult language using the language switch function at the top of the programming screen. | It is always possible, by programming in an easier language, to convert your code to a more difficult language using the language switch function at the top of the programming screen. | ||
Linha 34: | Linha 33: | ||
> **We do not intend to make converters for easier languages because the purpose of sBotics is to introduce people to robotics education, and we want users to progress in difficulty and skill.** | > **We do not intend to make converters for easier languages because the purpose of sBotics is to introduce people to robotics education, and we want users to progress in difficulty and skill.** | ||
- | In general, we always advise using **[[rEduc]]** for your programs. However, if you are not familiar with text-based programming or already know advanced programming, | + | In general, we always advise using **[[en:rEduc]]** for your programs. However, if you are not familiar with text-based programming or already know advanced programming, |
===== Understanding Synchronous Programming (Advanced) ===== | ===== Understanding Synchronous Programming (Advanced) ===== | ||
Imagine that sBotics is like a stage where the robot performs its actions. In a traditional robot, it is its own stage, where it does its things without worrying too much about what might happen to the program. If the program is inefficient and causes memory to run out, the robot will simply shut down or stop. It is important to understand that sBotics and your robot share the same stage. An inefficient function in your robot can make the entire sBotics slow, or even exhaust the program' | Imagine that sBotics is like a stage where the robot performs its actions. In a traditional robot, it is its own stage, where it does its things without worrying too much about what might happen to the program. If the program is inefficient and causes memory to run out, the robot will simply shut down or stop. It is important to understand that sBotics and your robot share the same stage. An inefficient function in your robot can make the entire sBotics slow, or even exhaust the program' | ||
Linha 40: | Linha 39: | ||
> **For those more studied in programming: | > **For those more studied in programming: | ||
- | How does this affect programming? | + | How does this affect programming? |
* "While true": Indiscriminate "while true" statements crash sBotics, as it waits for the robot to finish something that never finishes before continuing to run the simulator. | * "While true": Indiscriminate "while true" statements crash sBotics, as it waits for the robot to finish something that never finishes before continuing to run the simulator. | ||
* Waiting is important: In real robotics, commands take time to execute. Now, in sBotics, you **must** use a command called " | * Waiting is important: In real robotics, commands take time to execute. Now, in sBotics, you **must** use a command called " | ||
Linha 65: | Linha 64: | ||
==== How to Resolve? ==== | ==== How to Resolve? ==== | ||
To solve problems with your code, always separate your code into tasks, functions, and blocks that you can comment out or remove to test cases in isolation. This way, you can get a better idea of what is happening and where. In the vast majority of cases, problems that result in crashes come from inefficient programming, | To solve problems with your code, always separate your code into tasks, functions, and blocks that you can comment out or remove to test cases in isolation. This way, you can get a better idea of what is happening and where. In the vast majority of cases, problems that result in crashes come from inefficient programming, | ||
- | ``` |
programming.1752870936.txt.gz · Última modificação: 2025/07/18 20:35 por admin