Kurono Guide
Intermediate Python
API
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.
Getting started
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:
world_state
The world_state
object tells you things about the map.
avatar_state
The avatar_state
object tells you things about your avatar.
Direction constants
Actions
An Action
is the move you can make on a given turn. There are different types of actions:
Cell
Last updated