Whitespace
Does it matter whether you put the opening brace on its own line or not?The program runs as if nothing has changed. However, it is highly recommended to use the whitespace as a way to organize long programs. Programming etiquettes and clean coding can help navigate long programs much easier. Practicing good programming etiquettes also transfer over to other programming languages. Not all programming languages share the same commands and structures, but clean coding carry over can make learning new languages easier. |
Sequence of Computer Programming
In programming terms, the repeat structure is called a “loop”. In computer programming, a loop is a sequence of instructions that is continually repeated until a certain condition is reached. In this example, the condition is repeat four times.Changing the number of attempts will cause the repeat structure to loop that number of times. Placing additional commands above the loop will run that command first, then the loop. Anything underneath the loop will run after the loop completes its run. Replacing the number inside the loop with "forever" will cause the loop to run in an infinite loop. |
Did you know?
Whitespace![]() |
Whitespace is the location between keywords and symbols in the text-based language. |
Did you know?
Semicolons and Structures![]() |
Notice that some commands have semi-colons and other do not. Semicolons are used to denote the end of a command or statement in ROBOTC. Looping Structure, such as the repeat loop, do not have a semicolon on the defining statement of the loop. |
Did you know?
Behaviors (aka Decompositions)![]() |
A key programming concept is called decomposition. In robotics we call this breaking the robot’s movements into behaviors. |
Mini Challenge 1: Circle Maze
This challenge features a sequence of turns that the robot must perform in order to travel through the maze twice. The robot must first begin at the starting point and get to the goal area by completing turn and forward movement behaviors.
|
Mini Challenge 2: Circle Maze Rewind
This challenge features a sequence of turns that the robot must perform in order to travel through the maze twice. The robot must first begin at the starting point and get to the goal area by completing turn and forward movement behaviors.
|