BBC-microbit-Code-Kingdoms-Cookbook.pdf
(
3239 KB
)
Pobierz
codekingdoms
BBC micro:bit Cookbook
Using the Code Kingdoms
JavaScript editor
0
1
2
3V
GND
for kids, with kids, by kids.
Contents
Introduction & Accessing the editor
Tour of the Code Kingdoms JavaScript editor
Tutorial system & Comments within code
Error checking system
Learning Outcomes
Earning Open Badges
Recipe 1:
Roll the Dice [Are You Feeling Lucky?]
Recipe 2:
Mood Swing
Recipe 3:
Flashpoint
Recipe 4:
Worst. Snake. Ever.
Recipe 5:
Quickfinger
Recipe 6:
Maze Runner
Challenges and solutions
2
3
4
5
6
8
10
11
14
20
24
27
32
1
Introduction
The Code Kingdoms JavaScript editor we are contributing to the BBC micro:bit began life as part of
Code Kingdoms, a game that teaches children to code. We have decoupled and improved the
editor to sit alongside the Python editor, Block Editor and Touch Develop as one of the tools to
program the BBC micro:bit.
Our drag-and-drop interface makes the editor accessible to beginners and our “slider” supports the
transition to text-based programming as learners’ coding skills progress.
This booklet guides you through six different games of increasing difficulty to program your BBC
micro:bit. The first three games have step-by-step instructions, or recipes, that make
familiarisation with different parts of the editor straightforward. The latter three games require you
to build upon the skills and knowledge learned in the early games and, therefore, provide less
guidance. Each activity has an idea for an extension which will add complexity to the game.
All of the recipes are supported by the tutorial system within the editor. Users can choose the game
they want to build from the tutorial tab in the left sidebar, and the editor will guide them towards
completion. As with this written guide, the first three tutorials provide much more support and are
primarily aimed at being used with the visual editor, whereas the latter three will be based in the
textual view of the editor and provide a skeleton of the code that needs to be written.
The coded solutions to each game are listed on the Challenges and Solutions page of this guide.
Accessing the editor
The CK JavaScript editor is best accessed using Google Chrome as your web browser.
1.
Visit:
microbit.co.uk/create-code
2. Select ‘New Project’ under the CK JavaScript editor
2
Tour of the Code Kingdoms JavaScript editor
What is it?
1.
Main coding window
What is it for?
Writing code! This is where you can drag blocks of code or use a
text input to write programs.
a. micro:bit - access code chunks to control the behaviour of
the micro:bit
b. Library - Math, Random and Globals code libraries
c. Language - access to loops and conditionals
d. Snippets - allows you to copy and save snippets of code for
later use
e. Tutorial - guidance to complete the coding activity
Run and compile your code and return to My Scripts.
Transitioning between drag-and-drop code and text-based input
to support learner progression. Also a useful tool for motivating
learners and differentiating activities.
Test out your code on the micro:bit simulator before compiling it to
your device.
2. Menu
3. Action buttons
4. Slider
5. micro:bit simulator
3
Tutorial System
The editor’s in-built tutorial system guides you through the recipes in this booklet. The guidance for
each recipe is found under the tutorial tab:
The first three recipes have tutorials with close guidance whereas the second three place a greater
emphasis upon discovering how to complete the recipe yourself.
Comments within code
Part of the tutorial system includes comments which aren’t compiled as code but are designed to
provide additional guidance. Comments are signalled by two forward slashes at the beginning of
the line:
E.g. // this is a comment
You can add comments to your code by using the ‘raw code’ setting of the slider which allows you
to type the comment you wish to include.
4
Plik z chomika:
Automan1964
Inne pliki z tego folderu:
microprocessor interfacing techniques.pdf
(109882 KB)
Beginning BBC micro bit.pdf
(25106 KB)
252630.pdf
(16622 KB)
networking_with_the_microbit.pdf
(12857 KB)
MicrobitLessonfull_withLessondividers.pdf
(22241 KB)
Inne foldery tego chomika:
00 - Raspberry Pi
01 - Esp8266
02 - Arduino
02 - Arduino2
03 - Electronica
Zgłoś jeśli
naruszono regulamin