Tag Archives: programming

More on BBC Basic

Since my previous post about BBC Basic I’ve been looking into the topic further, and it appears the language might have something going for it after all – it’s very similar to the pseudocode used by OCR, and OCR seems to be supporting it, as they have provided training materials using BBC Basic to illustrate solutions.

 

One problem the language does seem to have is a lack of materials available, so I decided to have a go at remedying that, and have produced a KS3 workbook, similar to my Python workbook, which provides guidance into the first few steps of programming – input, output, variables, IF statements and loops – using BBC Basic, including simple exercises. My intention is that the booklet provides enough information for the more able students to progress by themselves, while others will benefit from extra guidance from their teacher.

 

I myself missed out on BBC Basic, as by the time it was introduced in schools I was at the top end and about to leave, but I did start off with Sinclair Basic, which was very similar. I do miss the old days of line numbering, but I have to admit that these days it’s far easier! If there is a generation of teachers out there who need to learn how to teach computing in a hurry and they’re already familiar with – or even just have a passing acquaintance with – BBC Basic, then capitalising on that would seem to be a viable way forward.

 

I intend to look further still into BBC Basic and pseudocode, as students are expected to understand pseudocode anyway for OCR GCSE Computing, and being able to write programs in pseudocode that translate directly into executable code would be useful, but I do feel that there needs to be some sort of introduction to another language as well. Watch this space for more news on training materials.

 

I remember reading once (a long time ago, admittedly!) that universities don’t want students who have already learned a programming language because they get confused when learning a second, but on the other hand those who already have experience in two find it far easier to learn a third. I myself have found that it’s the thinking and planning skills that are vital – once you understand exactly what you are trying to do, finding the exact syntax in the language of your choice becomes the easy bit. It’s like learning to drive a car – when you first learn, you’re bothered by every small difference in another car – the side the indicator is on, the biting point of the clutch – but once you gain more experience you’re aware of the differences and can work better with the similarities.

Hopscotch – programming on iPad

Hopscotch looks similar to Scratch in many ways

Hopscotch looks similar to Scratch in many ways

I’m always on the look-out for interesting ways to introduce children to programming, and recently I came across Hopscotch, a free iPad app.

 

At first glance, Hopscotch looks very much like Scratch, but it is much simpler, while making full use of the interface possibilities of an iPad.

 

Blocks available to use are limited to

  • motion: move, rotate, set heading, change x by, change y by, set speed
  • lines: leave a trail… end, set line color, set line width, clear
  • controls: repeat… end, wait
  • looks: scale by, set opacity, change costume
  • operators: random

Each script starts with an event trigger:

  • When play button pressed
  • when I shake the iPad
  • When I tap the stage
  • when I tilt the ipad down/left/right/up
  • when I tap the object
  • when I hear a loud noise
  • when [this object] collides with……

    The program can produce simple graphics

    The program can produce simple graphics

One sample program that came with the app produces this output, by using several sprites to each draw a section of the image:

 

My first reaction was that not having the full functionality of Scratch is a real disadvantage – there is no possibility of embedded maths, for example, because the only operator offered is one that generates a random number.

 

Part of the code for the Sydney Opera House program

Part of the code for the Sydney Opera House program

However, on reflection, this could also be a strength, as limiting the code that can be used forces attention on those that can be used, so the coder can really explore the possibilities without getting too bogged down in complicated code blocks.

 

It’s my impression that the app is constantly under review and development, as since I first investigated it the collision function was added, so it’s very possible that within a few months Hopscotch turns out to be a fully developed, child-friendly graphical app design tool.

 

Tabs show different sprites in the program, while a simple diagram helps with placement on screen

Tabs show different sprites in the program, while a simple diagram helps with placement on screen

In the meantime, it does offer basic functionality that enables creators to create interactive animations and activities involving basic logic. Its Event -> Action format would also serve as a good introduction to Gamemaker or other similar products, and of course the drag and drop graphics make it very easy for even young children.

 

I suspect that older children would find this rather limiting after a while, but I would certainly recommend it at key stage 2 for exploring possibilities in programming, and even as a cross-curricular maths tool, exploring distances and angles, for example giving a drawing to copy and seeing if children can describe the sequence needed to draw it.  Results could of course be recorded by screenshot and drawings to copy can be as simple or complex as needed, leading to natural differentiation by task.

 

There is a limited selection of cartoon-like graphics that can be added to projects, plus a text object. This limits what can be done rather, but again I suspect that this could well be developed in the near future, including hopefully the ability to import your own graphics.

 

There is a limited selection of objects available, plus a text object

There is a limited selection of objects available, plus a text object

In summary, a basic tool that provides a good introduction to programming for younger children and has strong possibilities, but which at the moment is likely to be rapidly outgrown by anyone who has already experienced Scratch, as the interactivity offered by the iPad is negated by the limited instruction set.

 

If you have a class set of iPads, then this is would be useful. If you haven’t, then you’re not missing very much at the moment, but this could well be one to keep an eye on for the future.

Python at Key Stage 3

a simple programI recently had the pleasure of introducing some year 8 and year 9 pupils to Python. They had previously dabbled in Scratch, but the idea of writing formal text-based programs was new to them, so we took it slow and steady.

 

The first lesson was mostly taken up with getting to know Python – we started by typing commands directly into the shell, and then they learned how to open up a new window, type a simple program into it and run the program. By the end of the first lesson they could type up print statements and simple maths statements into a program listing, save it correctly and run it.

 

Lesson 2 introduced the idea of variables and input. I reminded students at the beginning of the session how to start up a new window and create a program rather than type into the shell, and how to save their program with .py on the end to conserve the colour coding. They were also starting to discover the pleasures of debugging, and learning to look carefully at their code to spot errors. They helped each other out with this, and I showed them how to check not only the area of code that Python highlighted as a concern, but to check just before it as well, as often the error was missing speech marks or closing brackets.

 

Lesson 3 was where the real fun began, as we looked at if statements. Combining these with input meant that we could create a question and answer program, and combining that with a variable called score gave them the option of creating their very own quiz. Reactions varied, as some struggled to get their program running and grew frustrated while others started to really fly, creating inventive listings that checked for a user name and password before allowing access to the quiz. Generally, they seemed to enjoy the sessions, and my favourite reaction was that of frustration expressed as the code refused to work, followed by that surge of satisfaction and achievement as the error was spotted and fixed.

 

Our work developed by way of writing programs to solve problems, and for this I used my flash resources. This had the advantage of offering different levels of challenge and support, so that those who were able could work at a higher level while I could help those who were really struggling. By the end of the sessions all students understood a little more about how programs are made and they had learned that little details like capitals and spelling really matter. Most were starting to see how their program worked and how to fix errors and develop the functionality, while a small number really enjoyed the unit and were starting to come up with their own ideas and solutions.

 

This was only a very brief introductory look at programming, but it was enjoyable and worthwhile as a taster of computing rather than ICT, especially for those going into options, and encouraged students to think carefully and increase the accuracy of their written work. I saw expressions of satisfaction from both ends of the ability level, as those who struggled finally got something working while those who experimented showed off what they had managed to work out for themselves. Students whose first reaction as “This is stupid” moved over to “Oh, I see what the problem is”, as they learnt that the computer would do exactly what was it was told to do, and discovered for themselves the harsh realities of Garbage In Garbage Out. Even if they never see another Python statement, I believe they’ve taken away the understanding of how carefully you need to express yourself in order to be properly understood and how accuracy leads to better results.

 

As a result of my experiences I’ve developed a workbook and some flash resources, which you can find on my website here.