Join 36000+ teachers and students using TTIO.
You can also watch the learning presentation video to gain an overview of the concepts and coding covered in this section.
If statements and conditional logic are one of the most important programming constructs.
CHALLENGE: Add code to this program, so that if the value of x (the block moving along the x axis) is less than 20, then the 'Welcome' message will turn to '....to the left..'
Loops are incredibly useful, if not downright magical, for when you wish to repeat a task several times. You'll come across them all the time in coding
CHALLENGE #1: Change just one thing in the code to make it print 10 blocks
CHALLENGE #2: Change the code so that it creates a horizontal block of 5 blocks (going across not down)
CHALLENGE #3: (Difficult!) Change the code so that it creates 20 tiny blocks going across: