This program is a Test-Driven Development (TDD) exercise based on the YouTube video by @mica16 (Michael Azerhad) on TDD. The repository is built using PHP 8.2.10.
Write a program that returns integers from 1 to 100. Consider the following rules:
- For multiples of 3, replace the number with "Fizz."
- For multiples of 5, replace the number with "Buzz."
- For numbers that are multiples of both 3 and 5, replace the number with "FizzBuzz."
The program's output should look like this: "12Fizz4Buzz78FizzBuzz...Buzz."
This README file provides an overview of the FizzBuzz TDD exercise. Below are some additional details for those who will be using or reviewing this repository.
To use this program, follow these steps:
-
Clone the repository to your local machine.
git clone https://github.com/delhombre/fizzbuzz.git
-
Change into the project directory:
cd fizzbuzz
- Install dependencies
make install
- Run tests
make tests
You can run the FizzBuzz program by instantiate the FizzBuzz class in any PHP file and use the generate method which take two parameters (min and max number);
// my-file.php
$fizzBuzz = new FizzBuzz();
echo $fizzBuzz->generate(1, 100);
Run it in the shell:
php my-file.php
If you'd like to contribute to this repository, please follow these guidelines:
-
Fork the repository on GitHub by clicking the "Fork" button in the top-right corner of the repository page.
-
Clone your forked repository to your local machine:
git clone https://github.com/your-username/fizzbuzz.git
- Create a new branch for your feature or bugfix:
git checkout -b feature-name
- Make your changes, add, commit, and push:
git add .
git commit -m "Add feature or fix bug"
git push origin feature-name
- Create a pull request from your forked repository on GitHub. Be sure to provide clear details about your changes.
Special thanks to @mica16 for the TDD inspiration and the YouTube video that served as a reference for this exercise.