LoginSignup
5
5

More than 5 years have passed since last update.

バッチファイルでもズンドコ

Posted at

我々SIerはコマンドプロンプトでもズンドコせねばならない

zundoko.bat
@echo off

set /A count=0
:here
  set /A rnd=%RANDOM% / 16324
  if "%rnd%"=="0" (
    set zd=ズン
    set /A count=%count%+1
  ) else if "%count%" lss "4" (
     set zd=ドコ
     set /A count=0
   ) else (
     echo ドコ キ・ヨ・シ!
     exit /b 0
   )
  set /p NOLINEBREAK="%zd% "<nul
  goto here

けどたまにはエスアイヤーもおまじないを唱えたくなることもある

zundoko.ps1.bat
@(more +1 "%~f0" & echo. ) | powershell -Command - & exit /b 0

for ($count=0;;) {
  if ($(get-random 2) -eq 0) {
    Write-Host -NoNewLine "ズン "
    $count++
  } elseif ($count -lt 4) {
    Write-Host -NoNewLine "ドコ "
    $count=0
  } else {
    Write-Host "ドコ キ・ヨ・シ!"
    break
  }
}

これだけだとそんなに違いを感じられなくてアレだ…

5
5
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
5
5