< Back

Lab 16: Text and Conditionals

For all of our activities, make sure your practice with the new blocks today. Some of the activities you can complete without using the new blocks. They do save some time and headaches. Open up the Practice Area, and take a crack at the following activities.


Activity 1: Reverse String

Create a blockly program which allows the user to input a string of text. Your progrram should then output the string in reverse order. This is similar to how we reversed sounds last week.


Activity 2: Words

Create a blockly program which allows the user to input a string of text. Your program should then output each individual word from the input string. For now, assume that each word in the string will be separated by a single space character. You can use this fact, plus conditionals and the accumulator, in order to generate a string representing a word from the text file.

For bonus credit, instead of just printing each word from the input string, build a list containing each of these words.