From 06fb5aceeb65a75b1cd643debd667c52fdcafcb9 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 8 Nov 2026 14:10:02 -0800 Subject: Better error messages Better error messages. Buffs to the std lib; getch() to fetch a single character; streaming I/O handles retries, and large sizes, with better error reporting. Formatted strings. Default int moved to i32. TicTacToe, the game. --- chapter30/src/test/java/com/seaofnodes/simple/Chapter24Test.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'chapter30/src/test/java/com/seaofnodes/simple/Chapter24Test.java') diff --git a/chapter30/src/test/java/com/seaofnodes/simple/Chapter24Test.java b/chapter30/src/test/java/com/seaofnodes/simple/Chapter24Test.java index 2bc2ce7f..f4c4f12f 100644 --- a/chapter30/src/test/java/com/seaofnodes/simple/Chapter24Test.java +++ b/chapter30/src/test/java/com/seaofnodes/simple/Chapter24Test.java @@ -20,9 +20,9 @@ public class Chapter24Test { @Test public void testRecursiveWidening() { String[] srcs = { // Parm(x) must widen even though the recursive result is constant. - "val f = { int x, int limit -> x >= limit ? 0 : f(x+1,limit); }; return f(0,arg);", + "val f = { int x, int limit -> x >= limit ? 0 : f(++x,limit); }; int limit=arg; return f(0,limit);", // The growing result has its own cycle, which never crosses Parm(x). - "val f = { int x -> x <= 0 ? 0 : f(x-1)+1; }; return f(3);" + "val f = { int x -> x <= 0 ? 0 : f(--x)+1; }; return f(3);" }; for( int i=0; i