Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class

This commit is contained in:
2026-11-23 18:36:46 +01:00
parent 2243557bf5
commit 4d06edd045
55 changed files with 1679 additions and 675 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import 'console';
class Luhn {
private string $number;
@@ -33,9 +34,9 @@ class Program {
while($i < $nums) {
$luhn->setNumber($this->NUMBERS[$i]);
if($luhn->validate()) {
print('The number ' + $luhn->getNumber() + ' has passed the Luhn validation.' + "\n");
Console::Print('The number ' + $luhn->getNumber() + ' has passed the Luhn validation.' + "\n");
} else {
print('The number ' + $luhn->getNumber() + ' has NOT passed the Luhn validation.' + "\n");
Console::Print('The number ' + $luhn->getNumber() + ' has NOT passed the Luhn validation.' + "\n");
}
$i++;
}