LoginSignup
2
1

More than 5 years have passed since last update.

ズンドコキヨシ with VBScript

Posted at

「ズンドコキヨシ」に出遅れてVBScriptくらいしか残ってなかったです

vbscript
Option Explicit

Dim zundoko, loopCnt, result, tempResults

' 初期化
Call Init

Do While True
    ' 初期化
    If loopCnt > 5 Then
        loopCnt = 0
    End If

    ' 乱数の発生
    If Rnd < 0.5 Then
        zundoko.add "ズン"
    Else
        zundoko.add "ドコ"
    End If

    ' 5回目の時の確認処理
    If loopCnt = 4 Then
        result = zundoko(zundoko.Count-1) & zundoko(zundoko.Count-2) & zundoko(zundoko.Count-3) & zundoko(zundoko.Count-4) & zundoko(zundoko.Count-5)
        If result = "ズンズンズンズンドコ" Then
            Exit Do
        End If
    End If

    loopCnt = loopCnt + 1
Loop

result = ""
For Each tempResults In zundoko
    result = result & tempResults
Next
MsgBox result & "キ・ヨ・シ!"

' 初期化関数
Sub Init()
    loopCnt = 0
    Set zundoko = CreateObject("System.Collections.ArrayList")
End Sub

result.png

元ネタ
ズンドコキヨシまとめ

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1