Lesson 5
Do it now
![Picture](/uploads/1/3/5/0/13509255/5306323.png)
Last lesson you found out about the operating system or OS.
Write a list of OS's that you have heard about.
Explain what the two main purposes of the OS is.
Write a list of OS's that you have heard about.
Explain what the two main purposes of the OS is.
New Learning
Telling that computer what to do!You've finally arrived! You are now going to tell a computer what to do!
When your IT teacher was your age, we didn't have fancy computers, we had very basic ones. We didn't even have many games, but we could write our own. How? We learned to code in BBC Basic and now you will too. In this lesson you will learn to code a simple game called Snake in pairs. Click on this link to load the BBC B Emulator. You will see a webpage with the picture below in the middle. Click on the java applet and make sure your mouse stays in the applet area. |
Learning objectiveI can create a simple program in BBC Basic
Learning OutcomesALL Level 3
Understand that computer systems work step-by-step and can only do what we tell them. MOST Level 4 Be able to explain why we must be accurate when working with computers. SOME Level 5 Understand how data, such as numbers, sound and images are physically stored on a computer system. KeywordsBBC Basic
Programming Code Syntax Syntax error Command line |
Talk task
Doing something with it
Type in
PRINT "HELLO WORLD"
Press Enter
What does it do?
This is called a command line program and it only tells the computer to do one thing.
You are going to be working on creating a longer program but you need to know 2 things:
Your computer will only do what you want it to do if you tell it in the right way. If you don't, the emulator will tell you that you have make a mistake.
You need to watch your punctuation - this is called syntax. If you haven't put in the right commas and the right brackets, you will get a syntax error.
PRINT "HELLO WORLD"
Press Enter
What does it do?
This is called a command line program and it only tells the computer to do one thing.
You are going to be working on creating a longer program but you need to know 2 things:
Your computer will only do what you want it to do if you tell it in the right way. If you don't, the emulator will tell you that you have make a mistake.
You need to watch your punctuation - this is called syntax. If you haven't put in the right commas and the right brackets, you will get a syntax error.
Learning development
Making it do something more
Type in
CLS
This clears the screen.
Type in:
10 PRINT "HELLO WORLD"
20 GOTO 10
RUN
This is the most basic program you can run.
CLS
This clears the screen.
Type in:
10 PRINT "HELLO WORLD"
20 GOTO 10
RUN
This is the most basic program you can run.
graduating to proper programmingWorking in pairs, you will be programming a Snake game.
One person should type in the code One person should check their work to make sure the code works. TIP: To Open Brackets use SHIFT 8 and to close them SHIFT 9 TIP: If you make a mistake with the code, you can just retype the line number and it will be fine. Once you have finished the program, type RUN to make it work. Are there any errors? Can you find the line where the mistake is and correct it? |
![]()
The code above has LINE NUMBER and commentary.
Please type in ONLY the lines of code. If you want to add some commentary of your own, you need to add a new program line for example see below. 155 REM this bit of the program does this |
Independent task
stage one - creating your game area
10 MODE 1
20 GCOL 0,2
This changes the general colour from black/white to black/yellow
30 MOVE 100,100
40 DRAW 1100,100
50 DRAW 1100,900
60 DRAW 100,900
70 DRAW 100,100
RUN this and you will draw a yellow square.
Type LIST to show the program again and continue
20 GCOL 0,2
This changes the general colour from black/white to black/yellow
30 MOVE 100,100
40 DRAW 1100,100
50 DRAW 1100,900
60 DRAW 100,900
70 DRAW 100,100
RUN this and you will draw a yellow square.
Type LIST to show the program again and continue
take it further - over to you!
Working with your partner, code the rest of the game.
REMEMBER Syntax, Shift 8 = ( and Shift 9 = )
Once you have finished you can play the game to see how it works.
Challenge: can you get to 600 seconds?
REMEMBER Syntax, Shift 8 = ( and Shift 9 = )
Once you have finished you can play the game to see how it works.
Challenge: can you get to 600 seconds?
Plenary
This is what all of us IT teachers had to do when we were YOUR age. Complete the poll below and we will show the results on the board.
![Picture](/uploads/1/3/5/0/13509255/2175208.png)
Add the following key words to your computing dictionary and explain what they mean:
BBC Basic
Programming
Code
Syntax
Syntax error
Command line
BBC Basic
Programming
Code
Syntax
Syntax error
Command line