Restructuring
This commit is contained in:
11
solutions/Generic/99Bottles/desc.yml
Normal file
11
solutions/Generic/99Bottles/desc.yml
Normal file
@ -0,0 +1,11 @@
|
||||
title: FizzBuzz
|
||||
url: http://99-bottles-of-beer.net/
|
||||
|
||||
desc: Generate the lyrics to the song 99 Bottles of Beer as an output.
|
||||
|
||||
solution: See the code...
|
||||
|
||||
solutions:
|
||||
solve.php:
|
||||
desc: Basic solution
|
||||
language: php
|
18
solutions/Generic/99Bottles/solve.php
Normal file
18
solutions/Generic/99Bottles/solve.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?
|
||||
for ($beer=99; $beer>=0; $beer--)
|
||||
{
|
||||
if ($beer==0) {
|
||||
echo "No more bottles of beer on the wall, no more bottles of beer.".PHP_EOL;
|
||||
echo "Go to the store and buy some more, 99 bottles of beer on the wall.".PHP_EOL;
|
||||
}
|
||||
elseif ($beer==1) {
|
||||
echo "1 bottle of beer on the wall, 1 bottle of beer.".PHP_EOL;
|
||||
echo "Take one down and pass it around, no more bottles of beer on the wall.". PHP_EOL . PHP_EOL;
|
||||
} elseif ($beer==2) {
|
||||
echo $beer." bottles of beer on the wall, ".$beer." bottles of beer." . PHP_EOL;
|
||||
echo "Take one down and pass it around, ".($beer-1)." bottle of beer on the wall.".PHP_EOL . PHP_EOL;
|
||||
} else {
|
||||
echo $beer." bottles of beer on the wall, ".$beer." bottles of beer." . PHP_EOL;
|
||||
echo "Take one down and pass it around, ".($beer-1)." bottles of beer on the wall.".PHP_EOL . PHP_EOL;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user