Last active
August 8, 2016 12:32
-
-
Save stknohg/4d54f835f57f1ed416fb to your computer and use it in GitHub Desktop.
PowerShellでズンドコキヨシ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# PowerShellでズンドコキヨシ | |
# PowerShellらしさがあるか?と言われると微妙かな... | |
# | |
function Write-ZundokoKiyoshi(){ | |
$Zundoko = @("") * 5 | |
while($true){ | |
($Zundoko = $Zundoko[1..4] + (Get-Random @("ズン", "ドコ")))[4] | |
if( (-join $Zundoko) -eq "ズンズンズンズンドコ" ){ | |
return "キ・ヨ・シ!" | |
} | |
} | |
} | |
Write-ZundokoKiyoshi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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