Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
To gain familiarity with the Kurono environment and the turn-based approach
To recap on:
selection logic
random number generation
the basic use of subroutines
Find out how to access Kurono
Create a new game for your class by assigning a worksheet
Read over the pupil worksheet
Terminology
Avatar – digital player representing the pupil
Artefact – a special object that can be collected
Console log – the area at the bottom left of Kurono, used for output (print) messages
Introduce the environment: the aim of the game, how to run your code, concepts of the map, other avatars and artefacts (see Teacher User Guide)
Explain the turn-based model. A board game is a good analogy — you're only able to make a move when it's your turn
Explain the default code as necessary
Demo changing the code — make avatar walk in one direction only
Pupils start Kurono and change the code as the teacher did to ensure that they understand
NORTH, EAST, SOUTH
and WEST
are constants in the Kurono direction
object. The code MoveAction(new_dir)
converts the direction into a MoveAction
so that Kurono can carry it out.
The return
keyword returns this move to Kurono’s turn handler.
All pupils need to do here is move in any direction other than North simply so they can try out the interface.
Ask pupils or recap on what random.randint(start, stop)
does. E.g. print(random.randint(1,6))
Pupils may need some hints to work out that they can use a randomly generated number between 1 and 4 to help them choose a random direction to go in.
Then they'll need to use an if…elif…else
statement to choose the appropriate direction constant.
Potential pitfalls:
Poor structure of if…elif…else
statement
Forgetting to put direction.
before NORTH
, EAST
, SOUTH
or WEST
Forgetting to turn the direction constant new_dir
into an action with action = MoveAction(new_dir)
Pupils will probably have noticed that their avatar bumps into obstacles and can get stuck. This next task starts to look at how to avoid this by checking if they can move onto a cell before making their move. Pupils need to start with a working solution to task 2. Give them some code and explain how it works, if necessary.
avatar_state
is an object in Kurono that knows about the avatar, including its current location. The Kurono map is arranged in a 31x31 grid using x-y coordinates. The centre of the map has coordinates of 0,0.
Cross-curricular note: pupils will know about x,y coordinates from Maths. (What is the name for cell where x is 0 and y is 0? Answer: it's the origin)
Pupils can print out the coordinates of their avatar using this code:
print(avatar_state.location)
Pupils can also find out the x and y values separately.
print("x is", avatar_state.location.x)
print("y is", avatar_state.location.y)
Having got the avatar’s location, pupils can find out if they can move onto an adjacent cell by adding a direction constant and calling worldstate.can_move_to()
.
As you can see, world_state.can_move_to
returns a Boolean value.
Pupils can use this to decide what to do next.
Worksheet 2 picks up from this point.
Notice that there is no harm done if pupils try to move onto a cell that is occupied. They simply miss their turn.
Timing
Pupils’ prior experience
One lesson of approximately 50 mins
Pupils should be familiar with Python programming, including the use of:
Variables
Assignment
Selection (if statements)
Functions and procedures (subroutines)
Parameters
To extend algorithmic thinking to tasks to work out appropriate solutions
To explore the use of selection in a loop
To further explore the use of lists with indexing and iteration
Read over the pupil worksheet
This lesson builds on the previous lessons and allows your pupils to further investigate the use of selection, loops, arrays (lists in Python) as well as iterating over lists and using selection in a loop.
Ask pupils to read the introduction on their worksheet. We have provided them with starter code so they are all ready to move on to the next tasks. Ensure that they read the code carefully, using the comments to help them to fully understand it.
The running code will move their avatar towards the nearest artefacts and pick them up.
In this task, the code is examined further and pupils are are to extend it to show the description of the first thing in their backpack. They should be familiar with lists already but you might like to point out that the backpack is a list so they can look at individual elements using indexes in square brackets.
In the second task, pupils are asked to write a while loop to discover and output descriptions of each element in their backpack.
Pupils need to be able to use len() and list indexing.
Here is the suggested solution. Note that Kurono supports Python's formatted string literals (also called f-strings for short). A second example solution has been provided in case your class is not familiar with these.
Solution using f-strings
Solution without f-strings
Extension: can pupils change the output message so it outputs "a" or "some" depending on the item?
Here is one solution:
In this task, pupils need to count their artefacts by type. They need to create a variable for each artefact type, e.g. phone_count and add 1 to this value each time they find a match within a loop.
If they are unsure how to proceed, ask them where in their code they know the type of a single artefact. Answer: in the loop, here
Discuss the concept of running totals and perhaps try this as an exercise with any who are struggling to understand the concept:
I am going to say numbers to you and when I have finished, I want you to tell me their total. You cannot write them down or use a calculator. I might give you a lot of numbers so you won't be able to remember them all when I have finished. How are you going to add them up?
If they do not come up with a running total solution, then actually do this. Give them fairly simple numbers to add together but give them too many for them to be able to remember them all. Then ask them what they did.
What they did was this: every time you gave them a number, they added it to a total in their heads. The next question is: what was the total before I started giving you numbers? Answer: 0
Then they need to add code to count up phones and keyboards.
Here is one solution:
Extension: Some pupils might like to use lists for this task. They could create a 1D list of artefact type strings, e.g. TYPES = ["phone", "keyboard", "coins"]
and then have a separate counting list, e.g. counts = [0,0,0]
They could use a 2D list instead, if they prefer.
In this task, pupils are asked to make sure they have exactly five mobile phones and five keyboards. The backpack only holds ten things so they will need to drop any coins they are holding.
They can use a new function, find to get the index value of the first item of a specific type in their backpack. E.g.
Then they can return a DropAction with this index value so that Kurono removes this item from their backpack.
It is important to note that this function returns -1 if they are not holding an item of this type. They must only return a DropAction if the index is NOT -1. Otherwise, the last item in their backpack will be dropped and they might have wanted that!
Scaffold: first get pupils to drop coins. Then ask them to extend their code so that it drops mobile phones or keyboards if they have more than five of them.
Here is one solution.
Step 1: Drop coins
Step 2: Drop phones or keyboards if you have more than five of them
These tasks have allowed pupils to further explore the use of lists, iteration and selection in a loop, as well as interacting with the Kurono API.
Intermediate Python
API is short for application programming interface. It tells you how your program can interact with another program. In this case, it tells you how you can communicate with Kurono.
The aim of the Kurono game is to move around the map, avoiding obstacles and picking up different types of artefacts to return to a museum. You do this by writing Python code. The map is a 31 x 31 grid of cells and Kurono uses x and y coordinates to identify each cell.
You type your Python code in the code area and press Run Code to send it to Kurono. Assuming there are no syntax errors, Kurono will update the code it uses for your turn. You will notice your avatar on the map. If you are in classroom, there will be lots of others. You can identify yourself by the blue symbol and locate your avatar using the Find Me button. If your code prints anything, it will appear in the console area. This can get quite full of messages, so press the bin symbol to clear it. If you need to get the starter code back, press the Reset Code button.
When you first start in Kurono, you will find some code already there. This starter code is shown below.
Kurono uses a similar idea to a traditional board game. You can only make a move if it is your turn. When it is your turn, Kurono will call the code in your next_turn()
subroutine and run whatever code it finds there. Your code must create an Action
and return
it. Below is a full explanation of the starter code:
The world_state
object tells you things about the map.
The avatar_state
object tells you things about your avatar.
An Action
is the move you can make on a given turn. There are different types of actions:
To apply algorithmic thinking to tasks to work out appropriate solutions
To expand pupils’ use of selections statements to allow for multiple routes through their code
To consolidate knowledge of local variables in subroutines
To explore standard solutions such as counting different elements in a list
Read over the pupil worksheet.
This lesson builds on the previous lessons and allows your pupils to further investigate the use of selection, loops, arrays and subroutines. There are opportunities for discussing efficiency, local and global variables.
Pupils might have commented that they cannot easily control the direction their avatar takes. This has a great deal to do with the turn-based approach: the avatar is not designed to remember a fixed list of directions to take but rather to react to what is going on at each turn.
The new subroutine, world_state.scan_nearby()
returns a list of nearby artefacts. You need to pass in the avatar location to scan within the avatar radius. The first artefact in the list is the closest.
There is also a new action, MoveTowardsAction()
. You need to send this action an artefact to head towards.
The students will need to add the below as their starter code:
They will notice that their avatar is moving towards the artefact. It will not pick anything up though, since that code is not there yet.
Therefore, they now need to change this code to incorporate the pick-up action. The reminder given to pupils is:
Their code must return an action, in this case, it will be a PickupAction
or a MoveTowardsAction
. Here is a suggested solution:
When pupils pick up an artefact, it will disappear from the map and be moved to their backpack. They can check the number of items in their backpack using this code:
This challenge asks pupils to find five artefacts and output a message when they have achieved this. my_backpack
is a list of artefact objects so pupils can iterate (loop) over the list and examine each artefact in turn.
Any variables defined in a subroutine are local to that subroutine and are reset when the subroutine is next called. This means that pupils cannot keep a value in a variable between turns. They don’t need to use a local variable to remember the number of items in their backpack because they can check the length at any time. However, some might try this and be confused. They can use global variables if they wish. See below.
Important note
The code on the pupils’ worksheets will crash if they haven’t picked up any artefacts. It is important that pupils consider how lists work if they are confused by this.
In this part of the challenge, pupils only need to output what is in their backpack.
Part 2
The second part of the challenge asks pupils to count up the different types of artefacts found. This selection in a loop is an important standard counting algorithm.
These tasks have allowed pupils to further explore the use of selection and subroutines, as well as interacting with the Kurono API.
In the next worksheet, pupils will be able to scan areas of the map to look for artefacts and start to discover different types of artefacts.
(UK)
design, use and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems
understand several key algorithms that reflect computational thinking for example, ones for sorting and searching; use logical reasoning to compare the utility of alternative algorithms for the same problem
use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures for example, lists, tables or arrays; design and develop modular programs that use procedures or functions
understand simple Boolean logic for example, AND, OR and NOT and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers for example, binary addition, and conversion between binary and decimal audience, with attention to trustworthiness, design and usability
understand a range of ways to use technology safely, respectfully, responsibly and securely, including protecting their online identity and privacy; recognise inappropriate content, contact and conduct, and know how to report concerns
understand several key algorithms that reflect computational thinking for example, ones for sorting and searching; use logical reasoning to compare the utility of alternative algorithms for the same problem
use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures for example, lists, tables or arrays; design and develop modular programs that use procedures or functions
understand simple Boolean logic for example, AND, OR and NOT and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers [for example, binary addition, and conversion between binary and decimal]
All pupils must have the opportunity to study aspects of information technology and computer science at sufficient depth to allow them to progress to higher levels or to a professional career.
All pupils should be taught to:
develop their capability, creativity and knowledge in computer science, digital media and information technology
develop and apply their analytic, problem-solving, design, and computational thinking skills
understand how changes in technology affect safety, including new ways to protect their online privacy and identity, and how to identify and report a range of concerns.
Intermediate Python
Kurono is intended to be used by schools with a class of pupils. Your teacher will select the level for the class and you will all complete the challenges at the same time.
Kurono is an online multiplayer game that allows players to program their avatars to respond to the environment around them.
A player must instruct their avatar to perform actions such as search and collect objects. You do this by creating a subroutine of Python code. This code is run by Kurono when it is your turn.
Players should have some Python experience already. There is a Kurono guide for more information on the pre-built functions that can be used in the game.
To start using the game:
Here, you will be able to access the game your teacher has activated, which will be displayed in a large banner.
Present Day I: The Museum - Navigating the game
While working at the Scriptsonian museum for class credit, you have accidentally activated the mysterious Kurono time machine! It's down to you and your classmates to work out how to use it. Read through the instructions below that show you how to move around the map.
Kurono is a game that helps you develop your Python programming skills. You write code to move an avatar around a grid world, avoiding obstacles and other players and picking up objects you find on the map.
Kurono uses a turn-based approach. This is a bit like a board game where you can’t move unless it’s your turn. You need to write code to decide what move to make in a subroutine called next_turn()
and the game itself calls this subroutine when it’s your turn to move. Turns happen quite quickly though, so you don’t need to wait for long.
Your next_turn()
subroutine is sent the world_state
and avatar_state
objects which you will use in later worksheets to give you access to what is on the map and where you are on the grid. You can make use of the following built-in constants to move in a fixed direction:
direction.NORTH
direction.EAST
direction.SOUTH
direction.WEST
Notice that the map includes a compass to show you where North is. See Figure 1.
Subroutine
A subroutine is a section of code that is separate from the main code and needs to be called in order to run. You use subroutines in Python all the time. print()
and input()
are both subroutines but they are part of Python. You should already know how to write your own subroutines but if you don’t, just make sure that all the code you write is inside the def
block. See the example in Figure 1. The code on the left stores a northward move in the action variable and then returns it so the game can action it.
When you first open Kurono, you will notice that the code in Fig. 2 is already there. If you leave that code running, you will eventually get stuck on an obstacle block or the edge of the map. Try changing the code so that your avatar moves in a different direction instead. Remember to use one of the direction constants shown previously.
Now, can you write some code that moves your avatar in a random direction instead of just one fixed direction? Don't forget to add import random
at the top of your program as you would normally do. You will also need to use an if...elif...else
statement to help you here.
Need a hint?
You need to get Python to give you a random number between 1 and 4 and then use this to choose a direction to move in. The code below prints a random number to the console log and then moves North. Try it to work out what the numbers in the brackets are for and then finish the code.
Now your avatar is randomly wandering the map, they are likely bumping into obstacles and might be getting stuck for a few turns. In this next task, you will find out if you have collided with something. Start with your solution to task 2.
Add the line of code below before the return
:
print(avatar_state.location)
Look at the console log to work out what this code does. What do you think those numbers represent?
The Kurono grid world uses x-y coordinates for each square (or cell) on the grid. The code you added tells you the x-y coordinates of the cell your avatar is in. You can check if you can move onto a cell before you try to move using this code. Add it before the return.
Once you have done this, can you shorten this code so that it only outputs a message when you can't move?
Make sure that you return a WaitAction
if you can't move. You can do that like this:
Well done! You have learned about the basics of using Kurono and moving your avatar around the game board. In the next session, you will find out how to avoid obstacles and how to pick things up that you found on the map. You have investigated:
subroutines
generating random numbers
complex selection statements with if..elif...else
some properties of the game board to find out where you are
Present Day II: Obstacles and Artefacts
In the last worksheet, you learned how Kurono works and wrote your first programs to move around the grid world detecting obstacles around you. In this worksheet you are going to build on this: finding the artefacts you inadvertently scattered through time. Avoid the obstacles and pick up artefacts that you find on the map.
Start with the solution to the last challenge, you can use this example if you like. You don’t need to type in the comments. They are there to explain the code. Notice that we have set action to WaitAction()
if you don’t want to move; that is like missing a turn on a board game.
Change the code so that your avatar tries a different direction if they are unable to move. To avoid repeating code, create a subroutine called get_random_dir()
and use it to return a random direction. Think about where this would be called from and what code it will replace.
You might have noticed that your avatar is wandering around fairly aimlessly. Try to extend your code to favour moving in a particular direction.
You might have noticed some objects on the map, other than other pupils’ avatars. These are artefacts, objects you can pick up. There are different types of artefacts, some with a special purpose. For now, your challenge is to pick up any artefact that you find on the map. In order to pick up an artefact, you must be standing on the same cell as that artefact and then you need to call some Kurono code to pick it up.
Remember that you can find out your location using avatar_state.location
which contains the x-y coordinates of your current location:
coordinates = avatar_state.location
print(coordinates)
You can ask the Kurono game to tell you if there is an artefact on that cell using the code below.
If there is an artefact on that cell, you can pick it up using this code:
action = PickupAction()
You then need to return that action at the end of the next_turn
subroutine, instead of a move action.
return action
If you are successful, the artefact will disappear from the map and be moved into your backpack! Try changing your code to pick up any artefacts you encounter.
Start with the code shown below.
Well done! You have done a lot this session. You have found out how to avoid obstacles and influence which way your avatar moves. You have also learned how to pick up artefacts.
In the next worksheet, you are going to extend these ideas and actively scan the map for artefacts as well as look for specific types of artefacts. The artefacts are all-important, we need to get them back to the museum before someone else takes them!
21st Century
After successfully collecting all the missing artefacts from the first time checkpoint, you arrive at what looks like the 21st century. You recognise some cars parked here and there, just like the ones your history teacher told you about. In this timeline, there seem to be some things which will have no value in the museum. Make sure you don't fill your backpack up with things you don't need. More on this later...
At the end of the last challenge, you had written some code to pick up the nearest artefacts. Your code will have looked something like this. Read the comments carefully to make sure you fully understand the code.
Figure 1
Run this code until you have picked up some artefacts and then continue to Task 1.
You should already have had a look in your backpack using code like this:
You might have noticed that you can only hold ten artefacts in your backpack and might have seen this message: I have 10 things in my backpack. Uh oh! Your avatar was unable to pick up the artefact. Your backpack is full! 🎒
The challenges in the last worksheet asked you to examine what is in your backpack. Have a look back at the code in Figure 1 to find the nearest artefact (lines 13 - 16 reproduced below).
Line 2 above asks the world_state
for a list of all nearby artefacts and line 5 gets the first one. Notice the syntax: it uses square brackets to get the value at that index position. nearby
is a list, a group of values stored in one variable. You can get the first one by using an index of
We will use similar code with the backpack. Try adding this line of code:
You will get output something like this: I have 10 things in my backpack. The first thing in my backpack is a Artefact(type='phone')
To make the output more friendly, try this instead to output a description of the artefact:
Write some code with outputs the descriptions of each of your artefacts, e.g. What artefacts have you found?
The artefact at position 0 is a ????? The artefact at position 1 is a ????? The artefact at position 2 is a ????? The artefact at position 3 is a ?????
Make sure that your code uses a while loop and works no matter how many artefacts are in your backpack.
It is going to be useful to know exactly what is in your backpack. You can check what you are holding by comparing the descriptions to some constants, in a similar way to direction.NORTH
etc. that you used in the first challenge.
For example, this code compares the type of the first item in your backpack to a string, "phone"
Write some code that counts how many you have of each artefact. On this level, you can pick up phones, keyboards and coins. The strings you need are: "keyboard"
, "phone"
and "coins"
.
Great! Now you have control of your backpack!
You need to pick up exactly five keyboards and five mobile phones. If you have picked up other artefacts, like coins, you will need to drop them.
You can use this code to find an artefact that you don't want, e.g. to find a coins artefact
This code will give you the index position of the first coin in your backpack. If you don't have any coins, it will return -1.
You can tell use the DropAction to drop the artefact at that index, e.g.
action = DropAction(index)
Make sure you check that the index is not -1 before using it for a DropAction or you will drop the last artefact in your backpack instead which you have wanted to keep!
Hint: Think back to Task 2. How did you know the index of a particular artefact? You need this index to drop the item.
Ancient
In the last challenge, you found out how to avoid obstacles on the map and how to pick up any artefacts you encountered. You are now familiar with your equipment and have managed to unlock the gateway to the first time checkpoint.
Your avatar has been wandering the map aimlessly up to now. In this challenge, you are going to try to pick up five artefacts scattered across the sand and examine what type of artefact you have found.
Now you have got this far, you can use some more built-in code to help you move around and navigate.
The new subroutine world_state.scan_nearby()
returns a list of nearby artefacts (shown below). The first artefact in the list is the closest.
There is also a new action: MoveTowardsAction()
. You need to send this action an artefact to head towards.
Start with this code and watch to see what is going on.
Once you are satisfied that it is working, add code so that you pick up any artefacts you find and then head off to look for more.
Remember that you can use this code to check for artefacts and pick them up.
Your code must return an action. It can be a MoveAction, PickupAction
or a MoveTowardsAction
.
Now you have more control over your avatar’s direction, can you pick up five artefacts? my_backpack
is a list of artefacts. Try it using this command:
This code lets you look inside your backpack:
Think of your backpack as a list of items. Writing len(my_backpack)
gets the length of your backpack, i.e. how many items are in it.
Add some code that outputs how many items you have in your backpack and prints out "I have five artefacts, I win!" when you have picked up five.
Kurono uses subroutines. If you create a variable inside a subroutine, it is local so other subroutines cannot access it directly. Its value is also reset every time you call the subroutine. The code below will not work! It will always print "There are 1 things in my backpack", no matter how many artefacts you have picked up.
You might have noticed that there are different types of artefacts. Later on, you will need to check their type before picking them. For now, just make sure you know what you have. In this challenge, there are only key and chest artefacts. You can find out what you have in your backpack by looking at the artefact.type
for an item in your backpack. This code outputs the artefact type of the first artefact in your backpack.
NB: This code will crash if your backpack is empty!
Expand your program so that it outputs the types of all artefacts in your backpack when you have picked up five.
The artefacts on this level are key or chest only. Expand your program so that it outputs a summary of what you have in your backpack. E.g. I have 3 keys and 2 chests
Well done! You are really getting to grips with controlling your avatar now. You have found out how to control direction, how to examine your backpack and how to find out about the artefacts you are holding. You have also managed to find two different types of valuable artefacts to return to the museum with your class.
To be continued...
Timing | Pupils' prior experience |
---|---|
Open your web browser and go to: (fig.1).
2. as a student (fig.2)
3. Go to (fig.3)
Once you understand what this code is doing, print out a message to indicate if you can move to the next cell or not. The output should look something like this:
One lesson of approximately 50 mins
Pupils should be familiar with Python programming, including the use of:
Variables
Assignment
Selection
Functions and procedures (subroutines)
Parameters
Loops
Lists
Instruction
Definition
def next_turn(world_state, avatar_state):
Defines a subroutine called next_turn()
. This subroutine is sent the world_state
and avatar_state
objects which you can use to find out more about the map and your avatar. See below for their API.
direction.NORTH
Gets the NORTH
direction constant
MoveAction()
Turns the compass direction into a Kurono MoveAction
return
Returns your move to Kurono
Instruction
Definition
get_cell(location)
Gets the cell
at a specified location
can_move_to(location)
Returns a Boolean indicating if you can move to the cell in location
scan_nearby()
Returns a list of the 5 artefacts nearest to your avatar's location
Instruction
Definition
location
Gets the cell
of the location of your avatar
backpack
Returns the list of items inside your backpack
Instruction
Definition
direction.NORTH
Moves the avatar in a northerly direction
direction.SOUTH
Moves the avatar in a southerly direction
direction.EAST
Moves the avatar in a easterly direction
direction.WEST
Moves the avatar in a westerly direction
Instruction
Definition
MoveAction()
Asks the game to move your avatar to a new location
WaitAction()
Do not make a move
PickupAction()
Pick up an artefact from the current cell and add it to the avatar's backpack
MoveTowardsAction(artefact)
Move your avatar towards the artefact passed in as a parameter
Instruction
Definition
location
Gets the location object from a specific location
has_artefact()
Returns a Boolean indicating if there is an artefact on the cell
Timing
Pupils’ prior experience
One lesson of approximately 50 mins
Pupils should be familiar with Python programming, including the use of:
Variables
Assignment
Selection
Functions and procedures (subroutines)
Parameters
Loops
Task
Worksheets 1-4
Compare algorithms
-
Textual programming language
All worksheets
Arrays
Worksheet 3 onwards (backpack, world_state.scan_nearby())
Modular programs
All worksheets
Boolean Logic
Worksheet 4
Searching
Worksheets 3 onwards
Task
Notes
Kurono
OCR J277 (2020)
AQA 8525 (2020)
Edexcel 1CP2 (2020)
WJEC Eduqas 2020
CIE 0984 2022
Edexcel IGCSE C4PO 2017
OI AQA 9210
Linear Search
Worksheet 3 onwards (backpack)
✅
✅
❌
✅
✅
✅
✅
Binary Search
Understand, apply and identify from code only
✅
✅
✅
✅
❌
✅
✅
Bubble Sort
Understand, apply and identify from code only
✅
✅
✅
✅
❌
✅
✅
Merge Sort
✅
❌
❌
❌
❌
❌
❌
Insertion Sort
✅
✅
✅
✅
✅
✅
✅
Variables
All Worksheets
✅
✅
✅
✅
✅
✅
✅
Constants
All Worksheets
✅
✅
✅
✅
✅
✅
✅
Inputs
✅
✅
✅
✅
✅
✅
✅
Outputs
All Worksheets
✅
✅
✅
✅
✅
✅
✅
Assignments
All Worksheets
✅
✅
✅
✅
✅
✅
✅
Sequence
All Worksheets
✅
✅
✅
✅
✅
✅
✅
Selection
All Worksheets
✅
✅
✅
✅
✅
✅
✅
Iteration
Worksheet 3 onwards (backpack)
✅
✅
✅
✅
✅
✅
✅
Arithmetic operators
Worksheet 2 onwards
✅
✅
✅
✅
✅
✅
✅
Boolean operators
Worksheet 4
✅
✅
✅
✅
✅
✅
✅
Data types (integer, float, Boolean, char, string, casting)
All Worksheets
✅
✅
✅
✅
✅
✅
✅
String manipulation
Length, position, substring, concatenation
Planned for later worksheets
✅
✅
✅
✅
✅
✅
✅
File handling
✅
✅
✅
✅
✅
✅
✅
Arrays (1D and 2D)
Worksheet 3 onwards
✅
✅
✅
✅
1D only
✅
✅
Sub-programs
Worksheet 2 onwards
✅
✅
✅
✅
❌
✅
✅
Local and global variables
All worksheets (local variables)
✅
✅
✅
✅
❌
✅
✅
Random
Worksheet 1
✅
✅
✅
✅
✅
✅
✅
Naming conventions
All worksheets
✅
✅
✅
✅
✅
✅
✅
Commenting
All worksheets
✅
✅
✅
✅
✅
✅
✅
Code area | Map area |
This is where the you will write your code to control your avatar. When you have made a change to your code, press the “Run code” button.
| You will see your avatar on the map. The blue pointer above yours will help you distinguish your avatar from everyone else's.
|
Intermediate python
There are multiple ways to solve this task. Your pupils' first attempts may have been to move in another random direction (Solution 1) or turn around (Solution 2) when encountering an obstacle. However, these solutions are incomplete as there's no guarantee that another obstacle won't be in the next location. A complete solution would ensure that their next location doesn't contain an obstacle (Solution 3).
In this solution, we try another random direction but don't actually check if we can move there.
In this solution, we turn around (180 degrees) but don't actually check if we can move there.
In this solution, we keep trying a new random direction until we can move to our next location. This solution is more advanced and requires the use of a while
loop.
You may have noticed that we repeat code when selecting another random direction to move in. To avoid this repetition, a subroutine named get_random_dir()
may be created.
Up until this point, we had equal probability of randomly selecting one of the 4 random directions. Challenge your pupils to increase the probability of randomly selecting a specific direction.
Lesson plans, guides and solutions for Kurono
Here you can find everything you need to support your journey with Kurono - If you can't, please let us know by giving feedback.
The menu on the left-hand side is our space that holds guides, teaching materials and lesson plans to help you teach using Kurono. You need to click on the top navigation bar to view all of your options.
Top Tip
To print a page, click on the 3 dots to the right of the page title.
Intermediate Python
Kurono is an online multi-player game that is intended to be used in your classroom. The game is split into several levels to aid tracking and progress control and enable us to provide different starting code.
To create a new Kurono game you need to have a class and then assign it to a challenge level. You can switch to the following challenges with the class as you progress. Students' code will be saved unless you delete the set of games.
Kurono uses an avatar to represent each player. Your pupils will create programs to instruct their avatars how to respond to the environment around them. They do this by writing Python code that is run by the game. Their avatar will be able to do things like searching and collecting objects.
Players should have some Python experience already. There is a help sheet called Kurono Guide for more information on the pre-built functions that can be used in the game.
Here, you will have the option to create a new game by adding the class to the table. The system will automatically select the first challenge for any new class.
You can change this by using the drop-down menu within the table.
Once you have assigned the challenge to the class, the students will be able to see their active game on the student dashboard. They will have access to the active challenge sheet, user guide and Kurono guide from their dashboard as well.
It is a good idea to demonstrate the first bit of challenge 1 in front of the class to make sure the students understand how the game works before they have a go. You can do this by accessing the game through your teacher dashboard and simply changing the avatar's direction.
Once you have shown the class how to change direction, ask the students to login to their class using their username, access code and password or direct login link.
They should then select the Kurono option on their games page.
They will be taken to the Kurono student dashboard.
They can then read through the activated challenge, and when ready, they can start.
Note: If students find that they get the console message that 'there aren't any nearby artefacts', they will need to move their avatar closer to an object by using previous learning from worksheet 1 before continuing with the tasks.
To further investigate the use of selection, random numbers and subroutines
To use computation to solve problems with code
To find out how to pick up artefacts in Kurono and check inventory status
Read over the pupil worksheet.
This worksheet picks up from the end of worksheet 1 and pupils should have working code that outputs a message about the next cell. If necessary, explain the starter code on the worksheet.
The first challenge asks pupils to introduce a subroutine to help them choose another direction if they can't move in the direction chosen. You may need to recap on subroutines.
Here is a solution:
Choose another random direction
This solution favours moving South or West by increasing the number of random numbers generated and allocating more of them to a South or West move. Your pupils might do this in a different way.
Part of the story behind Kurono is that pupils travel through time to collect artefacts for a museum. This task allows pupils to start interacting with artefacts on the map. In later worksheets, pupils will find that there are different types of artefact but, for now, they're all the same.
Pupils can only pick up an artefact if their avatar is on the same cell on the map. They can use the location information to check if there is an artefact there. They might be able to see one, but the program needs to use a selection (if) statement to work it out!
They can then pick up any artefact they find by setting their turn action to a PickupAction
instead of a MoveAction
or WaitAction
.
You might need to remind pupils that a subroutine can only return one thing and should only ever have one return point. In terms of Kurono, what they return is their move and they can only make one move.
Pupils should output a message if they pick up an artefact.
These tasks have allowed pupils to further explore the use of selection and subroutines, as well as interacting with the Kurono API.
In the next worksheet, pupils will be able to scan areas of the map to look for artefacts and start to discover different types of artefact.
Open your web browser and go to:
Log in as a teacher and go to
Code area | Map area |
This is where the players will write their code to control their avatar. Once players have made a change to their code, they should press the “Run code” button. | Here you will see the player's avatar on the map. The blue pointer above it will help distinguish their avatar from others. |
After a few seconds, a notification will appear in the map view to show that their avatar is now running the updated code. | There is a compass in the bottom left of the map view to help players understand the orientation of the game map so that the correct direction instructions can be given. |
The console log will display the output of any print statement as well as error messages. | There is a "Find me" button in the bottom right corner for the player to click should they wish to recentre their avatar. |
Players can add print statements to help them debug their code. | The code written in the code view will be reflected in the avatar’s actions in the map view. |
Timing | Pupils’ prior experience |
One lesson of approximately 50 mins | Pupils should be familiar with Python programming, including the use of: |
|
How it all began...
It’s the year 2405. Humanity is finally seeing a time of bliss and stability, having bounced back from the 22nd Century “Great Collapse” that almost saw its extinction. The Earth was terraformed, colonies thrive on Mars, and solar sailing promises to get us far into space.
Titania is home to the Scriptsonian – one of the most prestigious museums of the republic, where traces of past times and civilisations rest. One curious artefact dating from before the Great Collapse has experts mystified. It's believed to be a time machine – but knowledge of how to make the machine work is long lost, if it ever existed.
The only inscription on this machine spells “K U R O N O”.
Each year, the museum’s curator welcomes a class from a local school to look after the exhibits for a few weeks. This year, a talented class from SAM (School of Algorithm and Matter) was rewarded with the task. These curious students were to spend their time in the museum’s grand halls, caring for every precious artefact and learning from the experience.
It was all going smoothly. That is until they stumbled across the mysterious time machine and accidentally set its gears in motion. The machine created a spacetime vortex, sucking in many of the museum’s valued possessions. By reading each object's timecode, it returned them all back to their original time and location.
Afraid that the incident might cost them their final grades, the students set off to retrieve the items scattered across five timelines using the very same time machine!