Skip to content

Instantly share code, notes, and snippets.

@stknohg
Last active August 8, 2016 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stknohg/4d54f835f57f1ed416fb to your computer and use it in GitHub Desktop.
Save stknohg/4d54f835f57f1ed416fb to your computer and use it in GitHub Desktop.
PowerShellでズンドコキヨシ
#
# PowerShellでズンドコキヨシ
# PowerShellらしさがあるか?と言われると微妙かな...
#
function Write-ZundokoKiyoshi(){
$Zundoko = @("") * 5
while($true){
($Zundoko = $Zundoko[1..4] + (Get-Random @("ズン", "ドコ")))[4]
if( (-join $Zundoko) -eq "ズンズンズンズンドコ" ){
return "キ・ヨ・シ!"
}
}
}
Write-ZundokoKiyoshi
#
# http://qiita.com/from_kyushu/items/905c7fe71183c5e0340c
# を参考にしたワンライナー版
#
$z,$d=$a="ズン","ドコ";while(($w=-join(0..4|%{random $a}))-ne($z*4+$d)){$w};$w;"キ・ヨ・シ!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment