Skip to content

Commit

Permalink
Update pxt.json, custom.ts, main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
neonerz committed Oct 31, 2020
1 parent 85bde05 commit 985648e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 13 additions & 1 deletion custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,17 @@ namespace hoc2020 {

agent.turn(turn);
}

/**
* Custom repeat loop so we could define
* default value
*/
//% block="repeat $n times"
//% n.defl=2
//% handlerStatement=1
//% draggableParameters="reporter"
export function customRepeatLoop(n: number, handler: () => void) {
for (let i = 0; i < n; i++){
handler();
}
}
}
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ...
5 changes: 3 additions & 2 deletions pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"files": [
"README.md",
"custom.ts",
"tutorial-info-cache.json"
"tutorial-info-cache.json",
"main.py"
],
"testFiles": [],
"public": true,
"targetVersions": {
"target": "1.5.49",
"target": "1.5.50",
"targetId": "minecraft"
},
"supportedTargets": [
Expand Down

0 comments on commit 985648e

Please sign in to comment.