Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| creating:scanning [2026/11/17 04:47] – Minor spelling fixes ahelwer | creating:scanning [2026/11/19 02:58] (current) – Change BufferedReader to class variable ahelwer | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| Almost everything in [[https:// | Almost everything in [[https:// | ||
| - | We do make one small functional modification: TLA⁺ source files are assumed to be encoded in UTF-8, a variable-width ASCII-compatible encoding, so we specify that when performing the file read. | + | We do make some small modifications: TLA⁺ source files are assumed to be encoded in UTF-8, a variable-width ASCII-compatible encoding, so we specify that when performing the file read; we also make the '' |
| Here's our main file, '' | Here's our main file, '' | ||
| - | <code java [enable_line_numbers=" | + | <code java [enable_line_numbers=" |
| package tla; | package tla; | ||
| Line 23: | Line 23: | ||
| public class TlaPlus { | public class TlaPlus { | ||
| + | private static BufferedReader reader = | ||
| + | new BufferedReader(new InputStreamReader(System.in)); | ||
| static boolean hadError = false; | static boolean hadError = false; | ||
| Line 45: | Line 47: | ||
| private static void runPrompt() throws IOException { | private static void runPrompt() throws IOException { | ||
| - | InputStreamReader input = new InputStreamReader(System.in); | ||
| - | BufferedReader reader = new BufferedReader(input); | ||
| for (;;) { | for (;;) { | ||