Extension: Can you get it to say Hello World like it is shown below. NOTE: You will need to use TextWindow.Write() as well as TextWindow.WriteLine().
Open Small Basic.
Type the following code:
TextWindow.WriteLine("Hello World")
3. Run your program.
4. Experiment with the following code (you will need to put this above the line you have just entered), what does it do?
TextWindow.BackgroundColor = "Blue"
TextWindow.ForegroundColor = "Red"
1. Open a new file in Small Basic.
2. Type the following code:
TextWindow.WriteLine("Enter the items in your shopping list")
TextWindow.Write("Item 1: ")
item1 = TextWindow.Read()
TextWindow.WriteLine("You selected " + item1)
3. Run the program and see what it does.
4. Add more code to the program so that it asks for five items in the shopping list and then displays the shopping list at the end.
Extension:
Can you change the foreground colour of the shopping list that it displays?
1. Open a new file in Small Basic.
2. Start your chat bot by typing the following code:
TextWindow.WriteLine("Welcome to the chat bot, what is your name?")
name = TextWindow.Read()
TextWindow.WriteLine("Hello " + name + " nice to meet you")
3. Run your program and check that it works so far.
4. You now need to continue your chat bot by coming up with four more questions to ask it and the chat bot must respond in an appropriate way, see the example of the right.
Extension:
Can you change the colour of some of the text to make the chat bot easier to follow?