Coding with Python - J0J0HA/CoatiPython GitHub Wiki

This sheet shows you the function, what it does, and the parallels to pythonkara.

Functions

coati What it does kara What it does in kara
coati.move() Move 1 field in the direction you are looking. kara.move() Move 1 field in the direction you are looking
coati.turn_left() Turn left. kara.turnLeft() Turn left
coati.turn_right() Turn right. kara.turnRight() Turn right
coati.put_worm() Spawn a worm at your current position kara.putLeaf() Spawn a leaf at your current position
coati.remove_worm() Removes a worm at your current position kara.removeLeaf() Removes a leaf at your current position
coati.on_worm() Checks if there is a worm at your current position kara.onLeaf() Checks if there is a leaf at your current position
coati.ball_front() Checks if there is a ball in front of you kara.mushroomFront() Checks if there is a mushroom in front of you
coati.stone_front() Checks if there is a stone in front of you kara.treeFront() Checks if there is a tree in front of you
coati.stone_left() Checks if there is a stone to your left kara.treeLeft() Checks if there is a tree to your left
coati.stone_right() Checks if there is a stone to your right kara.treeRight() Checks if there is a tree to your right
coati._alert(txt) Opens a alert-popup for output (BETA) print() Prints text to console (not supported)
coati._prompt(txt) Opens a prompt-popup for input (BETA) input() Asks for User-Input (not supported)

Kara like writing

Since commit 1185f09 with import kara instead of import coati you are able to use the original kara commands. Beta features are still only availible for the coati module. Note that only the function-names change, not the design. Since commit 1870619 it is also possible to select the kara-theme in the theme settings found in the burger menu.

Code execution

The following is written for the execution UI implemented in 2dad194.
Here you see the button in the UI and what it does.

Button Function
run Execute the code
stop Stop the code execution at the current position.
skip Skip the code execution to the end. (Notice #15)

With the speed-slider you can change the interval the states being applied in.
If you set it to immediately, All the states are being applied nearly at the same time. If you set it to 3, you'll need to wait 3 seconde after every move. I recommend to set it to 2.5.