diff options
| author | Cliff Click <cliffc@acm.org> | 2026-11-08 14:10:02 -0800 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-11-08 14:10:02 -0800 |
| commit | 06fb5aceeb65a75b1cd643debd667c52fdcafcb9 (patch) | |
| tree | c99813eaf27d98f840245302c4d6e923c964307e /chapter30/src/test/smp/examples/Capitalize.smp | |
| parent | 6560a92433a38825fd1d44d9c66ffba9f26990ff (diff) | |
| download | Simple-06fb5aceeb65a75b1cd643debd667c52fdcafcb9.tar.gz Simple-06fb5aceeb65a75b1cd643debd667c52fdcafcb9.zip | |
Better error messagesch30
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.
Diffstat (limited to 'chapter30/src/test/smp/examples/Capitalize.smp')
| -rw-r--r-- | chapter30/src/test/smp/examples/Capitalize.smp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/chapter30/src/test/smp/examples/Capitalize.smp b/chapter30/src/test/smp/examples/Capitalize.smp deleted file mode 100644 index 8e31c18f..00000000 --- a/chapter30/src/test/smp/examples/Capitalize.smp +++ /dev/null @@ -1,22 +0,0 @@ - -// An implementation of -// https://sampleprograms.io/projects/capitalize/ - -val main = { u8[~][] args -> - if( args# > 2 ) { - sys.io.p("Use quotes around multiple strings.\n"); - return 0; - } - if( args# != 2 || args[1]# == 0 ) { - sys.io.p("Usage: please provide a string\n"); - return 0; - } - - u8[~] input = args[1]; - var output = new u8[input# + 1]; - sys.ary.copy(output,0,input,0,input#); - output[0] = sys.char.toupper(input[0]); - output[input#] = '\n'; - sys.io.p(output); - return 0; -}; |
