From 7ff32d8bdd49e7287b94f6c203e52a7bc2af8993 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Tue, 13 Nov 2018 15:13:53 -0800 Subject: [PATCH] Update reactive.md --- docs/device/reactive.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/device/reactive.md b/docs/device/reactive.md index 85fa508c..f9b0bc50 100644 --- a/docs/device/reactive.md +++ b/docs/device/reactive.md @@ -48,7 +48,7 @@ The micro:bit’s *scheduler* provides the capability to concurrently execute di The first job of the scheduler is to allow multiple *subprograms* to be queued up for later execution. For our purposes, a subprogram is just a statement or sequence of statements in the context of a larger program. Consider the program below for counting button presses. -```blocks +```typescript let count = 0 count = 0 input.onButtonPressed(Button.A, () => { @@ -62,13 +62,13 @@ basic.forever(() => { The program above contains three statements that execute in order from top to bottom. The first statement initializes the global variable `count` to zero. -```blocks +```typescript let count = 0 ``` The second statement informs the scheduler that on each and every event of the **A** button being pressed, a subprogram (called the event handler) should be queued for execution. The event handler is contained within the braces `{...}`; it increments the global variable `count` by one. -```blocks +```typescript let count = 0 // ... input.onButtonPressed(Button.A, () => { @@ -78,7 +78,7 @@ input.onButtonPressed(Button.A, () => { The third statement queues a `forever` loop for later execution by the scheduler; the body of this loop (also inside the braces `{...}`) displays the current value of global variable `count` on the LED screen. -```blocks +```typescript let count = 0 // ... basic.forever(() => {