From ac428a393654bba02cb2afa82956a5a92cbc09f7 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 4 Jan 2018 22:13:17 -0800 Subject: [PATCH] invert arguments in print line --- libs/core/_locales/core-strings.json | 2 +- libs/core/screen.ts | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 05166172..964a75ef 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -36,7 +36,7 @@ "brick.buttonUp|block": "up", "brick.clearScreen|block": "clear screen", "brick.lightPattern|block": "%pattern", - "brick.printLine|block": "print %text| at line %line", + "brick.printLine|block": "print at line %line|%text", "brick.printPorts|block": "print ports", "brick.setLight|block": "set light to %pattern=led_pattern", "brick.showImage|block": "show image %image=screen_image_picker", diff --git a/libs/core/screen.ts b/libs/core/screen.ts index 466a5b48..eea33fab 100644 --- a/libs/core/screen.ts +++ b/libs/core/screen.ts @@ -92,10 +92,10 @@ namespace brick { * @param text the text to print on the screen, eg: "Hello world" * @param line the line number to print the text at, eg: 0 */ - //% blockId=screen_print block="print %text| at line %line" + //% blockId=screen_print block="print at line %line|%text" //% weight=98 group="Screen" inlineInputMode="inline" blockGap=8 //% line.min=0 line.max=9 - export function printLine(text: string, line: number) { + export function printLine(line: number, text: string) { const NUM_LINES = 9; const offset = 5; const y = offset + (Math.clamp(0, NUM_LINES, line) / (NUM_LINES + 2)) * DAL.LCD_HEIGHT; @@ -223,9 +223,6 @@ namespace brick { const x = i * 52; print(`${data.actualSpeed}%`, x, brick.LINE_HEIGHT) print(`${data.count}>`, x, 2 * brick.LINE_HEIGHT) - - console.logValue(`speed.` + "ABCD"[i], data.actualSpeed); - console.logValue(`angle.` + "ABCD"[i], data.count); } // sensors @@ -235,8 +232,6 @@ namespace brick { const x = (si.port() - 1) * 52; const v = si._query(); print(`${v}`, x, 9 * brick.LINE_HEIGHT) - - console.logValue(`sensor.` + si.port(), v); } } } \ No newline at end of file