99 бутылок: PowerShell
45. Windows Powershell.
Язык просто изучается, имеет понятную структуру и широкие возможности. Я посмотрел первую версию языка, но уже доступна вторая версия оболочки.
Программа, выводящая песню о пиве (beer.ps1)
# Написал Евгений Степанищев aka BOLK
function bottles([int]$beer) {
switch ($beer) {
0 { "no bottles" }
1 { "1 bottle" }
default { "$beer bottles" }
}
}
99..1 | ForEach-Object {
$bottles = (bottles $_) + ' of beer'
$bottles + ' on the wall, ' + $bottles + '.'
'Take one down and pass it around, ' + (bottles($_-1)) + " of beer on the wall.`n"
}
'No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.'