From 141a1de97613eb8760d16ac1c290eb200550c463 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 29 Aug 2023 20:58:35 +0200 Subject: [PATCH] Update write-code.ps1 --- Scripts/write-code.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/write-code.ps1 b/Scripts/write-code.ps1 index abf7c7fb..185b00cb 100755 --- a/Scripts/write-code.ps1 +++ b/Scripts/write-code.ps1 @@ -26,9 +26,9 @@ function GetRandomCodeLine { 0 { return $Tabs + "`$count = 0" } 1 { return $Tabs + "`$count++" } 2 { return $Tabs + "exit 0 # success" } - 3 { return $Tabs + "`$Files = Get-ChildItem C:" } + 3 { return $Tabs + "`$files = Get-ChildItem C:" } 4 { return $Tabs + "Start-Sleep -seconds 1" } - 5 { return $Tabs + "`$Generator = New-Object System-Random" } + 5 { return $Tabs + "`$generator = New-Object System-Random" } 6 { $global:Tabs = " "; return "} else {" } 7 { $global:Tabs = " "; return "} catch {" } 8 { $global:Tabs = " "; return "} elseif (`$count -eq 0) {" } @@ -39,21 +39,21 @@ function GetRandomCodeLine { 13 { return $Tabs + "return 1" } 14 { return $Tabs + "return 0" } 15 { return $Tabs + "Write-Progress `"Working...`" " } - 16 { return $Tabs + "[bool]`$KeepAlive = `$true" } + 16 { return $Tabs + "[bool]`$keepAlive = `$true" } 17 { return $Tabs + "# Copyright © 2023 write-code.ps1. All Rights Reserved." } 18 { $global:Tabs = " "; return "for ([int]`$i = 0; `$i -lt 42; `$i++) {" } - 19 { return $Tabs + "`$StopWatch = [system.diagnostics.stopwatch]::startNew()" } - 20 { return $Tabs + "[int]`$Elapsed = `$StopWatch.Elapsed.TotalSeconds" } + 19 { return $Tabs + "`$stopWatch = [system.diagnostics.stopwatch]::startNew()" } + 20 { return $Tabs + "[int]`$elapsed = `$stopWatch.Elapsed.TotalSeconds" } 21 { $global:Tabs = " "; return "if (`$count -eq 42) {" } 22 { $global:Tabs = " "; return "} finally {" } 23 { return $Tabs + "throw `"Can't open file`" " } 24 { return $Tabs + "Start-Sleep -milliseconds 42" } 25 { return $Tabs + "`$Choice = Read-Host `"Red or blue pill?`"" } - 26 { return $Tabs + "[int]`$Answer = 42" } + 26 { return $Tabs + "[int]`$answer = 42" } 27 { $global:Tabs = ""; return "}" } 28 { $global:Tabs = " "; return "try {" } - 29 { $global:Tabs = " "; return "foreach(`$Row in `$Table) {" } - 30 { $global:Tabs = " "; return "foreach(`$File in `$Files) {" } + 29 { $global:Tabs = " "; return "foreach(`$row in `$table) {" } + 30 { $global:Tabs = " "; return "foreach(`$file in `$files) {" } } }