From 39d210899a03400aa847aec042a354b9a827b853 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 31 Oct 2021 09:54:37 -0700 Subject: [PATCH] tutorial: tweaks to task 14 Thanks again sejo for your comments. --- tutorial/index.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tutorial/index.md b/tutorial/index.md index 463d7abd..3b9cf1d5 100644 --- a/tutorial/index.md +++ b/tutorial/index.md @@ -547,11 +547,18 @@ fn main screen: (addr screen), keyboard: (addr keyboard) { } ``` -Can you modify this program to print out the text read from keyboard a second -time? How about printing a space after every character (grapheme)? +`read-line-from-keyboard` reads keystrokes from the keyboard until you press +the `Enter` (also called `newline`) key, and accumulates them into a _stream_. +This is a good time to skim the section in the Mu reference on +[streams](https://github.com/akkartik/mu/blob/main/mu.md#streams), just to +give yourself a sense of what you can do with them. -Now skim the section in the Mu reference on [streams](https://github.com/akkartik/mu/blob/main/mu.md#streams). -Does the above program make sense? +Does the above program make sense now? Feel free to experiment to make sense +of it. + +Can you modify it to print out the line a second time, after you've typed it +out until the `Enter` key? Can you print a space after every character +(grapheme) when you print it out? ## Task 15: generating cool patterns