diff --git a/Generic/99Bottles/desc.yml b/Generic/99Bottles/desc.yml new file mode 100644 index 0000000..15510ce --- /dev/null +++ b/Generic/99Bottles/desc.yml @@ -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 diff --git a/Generic/99Bottles/solve.php b/Generic/99Bottles/solve.php new file mode 100644 index 0000000..a9f1b4b --- /dev/null +++ b/Generic/99Bottles/solve.php @@ -0,0 +1,18 @@ +=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; + } +} \ No newline at end of file diff --git a/Generic/FIZZBUZZ/desc.yml b/Generic/FIZZBUZZ/desc.yml index 45b3ec1..f261697 100644 --- a/Generic/FIZZBUZZ/desc.yml +++ b/Generic/FIZZBUZZ/desc.yml @@ -1,5 +1,5 @@ title: FizzBuzz -url: http://projecteuler.net/problem=1 +url: http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ desc: The classical coding challenge. Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers which are multiples of both three and five print FizzBuzz. diff --git a/Generic/HelloWorld/desc.yml b/Generic/HelloWorld/desc.yml new file mode 100644 index 0000000..a6002c3 --- /dev/null +++ b/Generic/HelloWorld/desc.yml @@ -0,0 +1,16 @@ +title: HelloWorld +url: http://en.wikipedia.org/wiki/Hello_world_program + +desc: A "Hello world" program is a computer program that outputs "Hello, world" on a display device. +solution: Do i need to say more + +solutions: + solve.php: + desc: Basic solution + language: php + solve.rb: + desc: Basic solution in Ruby + language: ruby + solve.c: + desc: ANSI C solution (Tested with TCC) + language: c \ No newline at end of file diff --git a/Generic/HelloWorld/solve.c b/Generic/HelloWorld/solve.c new file mode 100644 index 0000000..e54ab40 --- /dev/null +++ b/Generic/HelloWorld/solve.c @@ -0,0 +1,7 @@ +#include + +int main( ) +{ + printf( "Hello World" ); + +} \ No newline at end of file diff --git a/Generic/HelloWorld/solve.php b/Generic/HelloWorld/solve.php new file mode 100644 index 0000000..d57c21d --- /dev/null +++ b/Generic/HelloWorld/solve.php @@ -0,0 +1,2 @@ +