Programming by Example


A BB4W Compendium



Chicken and Egg problem...


Resource or tutorial, what comes first? Should a website explain the fundamental concepts of programming before providing examples of a level that students will find engaging? Which methods of teaching encourage creativity while stimulating curiosity?



Why BBC BASIC for Windows?


The 'B' in BASIC stands for Beginners, yet this site provides a mere glimpse of BB4W's sophistication. BB4W offers an excellent balance between fundamental programming concepts and flexibility. It's a friendly language too, with comprehensive error handling and reporting.



Who is this site good for?


Students of any age interested in learning to program and anyone who wants to have some fun at the same time. These two concepts are not mutually exclusive!



How are we going to do this?


This site includes various games, simulations and demonstrations. The author makes no apology for not beginning in the shallowest part of the pool. However, an incremental approach has been applied to the order of the programs listed. Explanations are not repeated.


Each page contains a listing that can be copied and pasted into the BB4W editor and immediately executed (run). Most listings are followed by a detailed explanation, so the reader can follow the logic while learning the language. The programs in this compendium are self-contained i.e. no additional graphics files or resources are required.


The reader is strongly encouraged to experiment.





A PC running the Windows operating system.

A copy of the language/application: BBC BASIC for Windows

Invaders Mandelbrot Bugs Archery

Programming and the UK National Curriculum


This website was inspired by changes to the national curriculum. While many of the examples contained here tend towards being advanced, the author believes that resources should be made available to expose students to the wider applications and possibilities of programming.


    Programming combines mathematics, problem solving, creativity and fun.

    Coding provides the most diverse range of creative options available to any group or individual.

    Programs can be used for teaching any subject.


For programming challenges, see the IDIC page.


Computing fundamentals are covered on the Start Here page. (Click on the owl)



If anyone would like to contact the author, with suggestions or requests, please email:


  [email protected]


A note on Computational Thinking and 'Creative Programming':


Programming/coding is being promoted in schools as a means to teach 'computational thinking'. It may be important to note that some areas of programming focus on communicating with devices (or virtual objects), rather than decomposition, pattern recognition, abstraction and algorithms. Having recently added a couple of examples relating to Direct3D, I realised that all programming involves passing instructions to powerful hardware (or software)...


...However, the notion of 'creative programming' i.e. the exploration and discovery of alternative solutions, may be an important distinction to make, when considering the true value of programming in regard to computational thinking.

Programming, Maths & Computational Thinking


What Should Teachers Know? Having spent a little time on educational-related sites, it appears that schools face several problems: Retaining computing teachers, acquiring teachers with computing knowledge, and little to no guidance from the National Curriculum.


From one point of view, it is apparent that teachers absolutely avoid maths in relation to programming, and Computational Thinking is being taught, in varied subjects, as a conceptual, rather than practical set of skills.


It can be demonstrated that programming is a subject as practical as woodwork or CDT, and that mathematics is an inherent aspect of programming.


The following pdf is a guide to What Every Teacher Should Know...


It shows how Maths, Programmming and Computational Thinking work together (at least, for those of us who were self-taught, worked professionally in the area and continue to program as a hobby). And it's provided here as an insight into an alternative universe, one that doesn't appear to relate to any current academic reality.