Compare commits

...

6 Commits

Author SHA1 Message Date
8de6605112 0.2.128 2016-05-24 14:32:27 -07:00
daea493dcb Bump pxt-core to 0.2.138 2016-05-24 14:32:11 -07:00
b290692334 using pxt constant to find binary .hex 2016-05-24 14:06:25 -07:00
f25f295d0c 0.2.127 2016-05-24 13:03:06 -07:00
5fd691ef92 Bump pxt-core to 0.2.137 2016-05-24 13:03:04 -07:00
67c8753315 Updating loop docs 2016-05-24 12:30:31 -07:00
4 changed files with 13 additions and 16 deletions

View File

@ -1,8 +1,8 @@
/// <reference path="../node_modules/pxt-core/built/pxt.d.ts"/> /// <reference path="../node_modules/pxt-core/built/pxt.d.ts"/>
import * as fs from 'fs'; import * as fs from "fs";
import * as path from 'path'; import * as path from "path";
import * as child_process from 'child_process'; import * as child_process from "child_process";
let writeFileAsync: any = Promise.promisify(fs.writeFile) let writeFileAsync: any = Promise.promisify(fs.writeFile)
let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Promise.promisify(child_process.exec) let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Promise.promisify(child_process.exec)
@ -13,10 +13,10 @@ export function deployCoreAsync(res: ts.pxt.CompileResult) {
if (drives.length == 0) { if (drives.length == 0) {
console.log("cannot find any drives to deploy to") console.log("cannot find any drives to deploy to")
} else { } else {
console.log("copy microbit.hex to " + drives.join(", ")) console.log(`copy ${ts.pxt.BINARY_HEX} to ` + drives.join(", "))
} }
return Promise.map(drives, d => return Promise.map(drives, d =>
writeFileAsync(d + "microbit.hex", res.outfiles["microbit.hex"]) writeFileAsync(d + ts.pxt.BINARY_HEX, res.outfiles[ts.pxt.BINARY_HEX])
.then(() => { .then(() => {
console.log("wrote hex file to " + d) console.log("wrote hex file to " + d)
})) }))

View File

@ -20,5 +20,5 @@ basic.showNumber(i)
### See also ### See also
[while](/reference/loops/while), [if](/reference/logic/if), [show number](/reference/basic/show-number) [repeat](/reference/loops/repeat), [while](/reference/loops/while), [if](/reference/logic/if), [show number](/reference/basic/show-number)

View File

@ -1,19 +1,16 @@
# Repeat # Repeat
Repeat code a preset number of times. Run part of the program the number of times you say.
### Block Editor ### Block Editor
![](/static/mb/blocks/contents-0.png) ![](/static/mb/blocks/contents-0.png)
### Touch Develop ### Lessons
Touch Develop has no `repeat` loop. Instead you can used a for loop [looper](/lessons/looper)
``` ### See also
for (let i = 0; i < 5; i++) {
}
```
The loop above will repeat five (5) times. [for](/reference/loops/for), [while](/reference/loops/while), [if](/reference/logic/if), [show number](/reference/basic/show-number)

View File

@ -1,6 +1,6 @@
{ {
"name": "pxt-microbit", "name": "pxt-microbit",
"version": "0.2.126", "version": "0.2.128",
"description": "BBC micro:bit target for PXT", "description": "BBC micro:bit target for PXT",
"keywords": [ "keywords": [
"JavaScript", "JavaScript",
@ -29,6 +29,6 @@
"typescript": "^1.8.7" "typescript": "^1.8.7"
}, },
"dependencies": { "dependencies": {
"pxt-core": "0.2.136" "pxt-core": "0.2.138"
} }
} }