- Aug
- 2,799
- 144
Requires TCC Version 36.00.24 x64 or later.
I've added example 9 to template.csx,
which demonstrates how to square each number in an array,
without using loops.
Attached please find the latest version of the CsScript plugin,
and the template.csx file.
Joe
I've added example 9 to template.csx,
which demonstrates how to square each number in an array,
without using loops.
Code:
// Example 9: Square each number in an array,
// without using loops.
// Example input array
int[] numbers = { 1, 2, 3, 4, 5 };
// Square each number without explicit loops
int[] squaredNumbers = numbers
.Select(n9 => checked(n9 * n9)) // checked to detect overflow
.ToArray();
// Display results
Console.WriteLine("Original: " + string.Join(", ", numbers));
Console.WriteLine("Squared: " + string.Join(", ", squaredNumbers));
Attached please find the latest version of the CsScript plugin,
and the template.csx file.
Code:
R:\>plugin /l csscript.dll
R:\>plugin /i csscript
Module: csscript.dll
Name: CsScript
Author: Joe Caverly
Email: [email protected]
Web: https://github.com/joec4281?tab=repositories
Description: CsScript command to run CSharp code
Implements: CSSCRIPT
Version: 2026.4 Build 10
R:\>csscript template.csx
No arguments provided.
Today's Date: 2026-04-11
Current Time: 14:17:33
Circle with radius 5: Area = 78.54
Is 121 a palindrome?
Yes
Three
TCC PShell get-date: April 11, 2026 2:17:33 PM
TCC PShell 2026-1960: 66
Original: 1, 2, 3, 4, 5
Squared: 1, 4, 9, 16, 25
R:\>
Joe