https://github.com/textbook/fizzbuzz-js
Basic Fizz Buzz project set up for Ada College pairing exercise
https://github.com/textbook/fizzbuzz-js
Last synced: about 1 month ago
JSON representation
Basic Fizz Buzz project set up for Ada College pairing exercise
- Host: GitHub
- URL: https://github.com/textbook/fizzbuzz-js
- Owner: textbook
- Created: 2018-06-19T08:29:08.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-19T08:29:41.000Z (about 8 years ago)
- Last Synced: 2025-06-22T01:47:40.947Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://codesandbox.io/s/rr1x0kwxq4?module=%2Fsrc%2Ffizzbuzz.test.js
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Fizz Buzz
=========
Rules
-----
The rules for Fizz Buzz are as follows:
- If a number is divisible by 3 (e.g. `3`, `6`, `9`), return `"Fizz"`;
- If a number is divisible by 5 (e.g. `5`, `10`), return `"Buzz"`;
- If a number is divisible by both 3 and 5 (e.g. `15`), return `"Fizz Buzz"`; and
- If none of the above applies (e.g. `1`), return the number as a string (e.g. `"1"`).
Test-Driven Development
-----------------------
The rules of test-driven development (TDD) are as follows:
1. **Red**: Always start with a failing test, in this case:
java.lang.AssertionError:
Expected: "1"
but: was null
Pro tip: *always read the error* before moving on to the next step, it may not be what you were expecting.
2. **Green**: Write the simplest code required to make the test pass; then
3. **Refactor**: Consider whether you need to rewrite any part of your code or tests, e.g. to make it easier to follow.
Once you're happy with your solution so far, return to step 1 and continue until the task is complete.
Pair programming
----------------
The point of the exercise is to solve the problem *as a pair*, so that you both understand all of the code you've
written. If you want any pointers, the content of the presentation is available online [here][blog].
[blog]: https://blog.jonrshar.pe/2017/Oct/13/ada-college-pairing.html
[intellij]: https://www.jetbrains.com/idea/download