Getting started - J0J0HA/CoatiPython GitHub Wiki

Your first project!

Here is a short tutorial for your first project.
In this tutorial, we want the chicken to walk over the field collecting all worms availible.

1. Create a map

To start coding, we first need to know the cicumstances. So create a map looking like the following:
map
It should be the chicken at the left looking to the right, a stone at the right and some worms in beetween.
If you struggle creating the map, read the map creation guide or ask at the discussions page if you can't get it to work.

2. Think about the problem

How would you try to solve this?
When we think about it, the chicken needs to do the following:
As long as we are not in front of the stone, move forward and collect a worm if it exists after every move.

3. The coding

But there is a problem: The computer doesn't understand human language. In CoatiPython, You'll, obviously, use python.
Therefore you can use the reference of coati's functions reference of coati's control-functions. If you never used python before, you should probably just copy the following and try to understand it or ask at the discussions page.
The (a) correct solution would be:
Explained python code

4. Testing

Now press the ▶-button and look what the chicken does.
Does it walk the correct way and does it collect all worms?
If it worked:

Well done! You finished the tutorial and can try to solve some more complicated tasks like labyrinth solving etc.
If you have questions, feel free to post them at the discussions page.

If it didn't work:

Try it again and compare your code to the example code above. Ckeck if there are typos or anything like that.
If you don't get your code to work or you don't find the mistake, feel free to post your code and your problem at the discussions page.

The solution

The solution of the tutorial can be downloaded at: CoatiPython Tutorial Solution. You just have to import it via the "Import" button in the burger-menu.