Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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