diff --git a/examples/hilo.mod b/examples/hilo.mod index 11f494c7b..701cd786a 100644 --- a/examples/hilo.mod +++ b/examples/hilo.mod @@ -6,13 +6,22 @@ MODULE HiLo; FROM InOut IMPORT WriteInt, WriteLn, WriteString, ReadString, ReadInt; FROM random IMPORT Uniform; +FROM Streams IMPORT FlushStream, OutputStream, StreamResult; VAR buffer : ARRAY [0..32] OF CHAR; +PROCEDURE flush; +VAR + strus : StreamResult; +BEGIN + FlushStream(OutputStream, strus); +END flush; + PROCEDURE reads; BEGIN WriteString("> "); + flush; ReadString(buffer); END reads; @@ -31,8 +40,8 @@ BEGIN finished := FALSE; WHILE NOT finished DO - WriteLn; WriteString("> "); + flush; ReadInt(guess); IF guess = Number THEN