Skip to content

Commit

Permalink
Create kara.py
Browse files Browse the repository at this point in the history
- Added support for kara-functions.
  • Loading branch information
J0J0HA committed Sep 23, 2022
1 parent d38dbd1 commit 1185f09
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kara.py
@@ -0,0 +1,19 @@
import js as __js

def __jsfunc(func):
def __wrapper():
result = func()
__js.saveState()
return result
return __wrapper;

move = __jsfunc(__js.window.coati.move)
turnLeft = __jsfunc(__js.window.coati.turnLeft)
turnRight = __jsfunc(__js.window.coati.turnRight)
putLeaf = __jsfunc(__js.window.coati.putWorm)
removeLeaf = __jsfunc(__js.window.coati.removeWorm)
onLeaf = __jsfunc(__js.window.coati.onWorm)
mushroomFront = __jsfunc(__js.window.coati.ballFront)
treeFront = __jsfunc(__js.window.coati.stoneFront)
treeLeft = __jsfunc(__js.window.coati.stoneLeft)
treeRight = __jsfunc(__js.window.coati.stoneRight)

1 comment on commit 1185f09

@J0J0HA
Copy link
Owner Author

@J0J0HA J0J0HA commented on 1185f09 Sep 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solved second half of #2

Please sign in to comment.