langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
21
Task/100-doors/VBScript/100-doors.vbscript
Normal file
21
Task/100-doors/VBScript/100-doors.vbscript
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
Dim doorIsOpen(100), pass, currentDoor, text
|
||||
|
||||
For currentDoor = 0 To 99
|
||||
doorIsOpen(currentDoor) = False
|
||||
Next
|
||||
|
||||
For pass = 0 To 99
|
||||
For currentDoor = pass To 99 Step pass + 1
|
||||
doorIsOpen(currentDoor) = Not doorIsOpen(currentDoor)
|
||||
Next
|
||||
Next
|
||||
|
||||
For currentDoor = 0 To 99
|
||||
text = "Door #" & currentDoor + 1 & " is "
|
||||
If doorIsOpen(currentDoor) Then
|
||||
text = text & "open."
|
||||
Else
|
||||
text = text & "closed."
|
||||
End If
|
||||
WScript.Echo(text)
|
||||
Next
|
||||
Loading…
Add table
Add a link
Reference in a new issue