├── 2017
├── 01-06-17
│ ├── README.md
│ └── katas
│ │ ├── bowling-game-OldTeam
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test.js
│ │ ├── bowling-game
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ │ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 04-05-17
│ ├── README.md
│ └── katas
│ │ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ │ └── roman-numerals
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 05-10-17
│ ├── README.md
│ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 07-09-17
│ ├── README.md
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ └── tennis-refactoring-kata
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── TennisGame1.js
│ │ ├── TennisTest.html
│ │ └── TennisTest.js
├── 10-08-17
│ ├── README.md
│ ├── banking-kata-group-1
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ ├── banking-kata-group-2
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ └── number-letter-counts
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 13-07-17
│ ├── README.md
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ └── roman-numerals
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 15-06-17
│ ├── README.md
│ ├── katas
│ │ └── fizz-buzz
│ │ │ ├── .nvmrc
│ │ │ ├── README.md
│ │ │ ├── package.json
│ │ │ └── test.js
│ └── tennis-refactoring-kata
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── TennisGame1.js
│ │ ├── TennisTest.html
│ │ └── TennisTest.js
├── 18-05-17
│ ├── README.md
│ └── katas
│ │ ├── bowling-game
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test.js
│ │ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 24-08-17
│ ├── README.md
│ ├── banking-kata
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ └── scrabble-score
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 25-10-17
│ ├── README.md
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ └── warriorjs
│ │ ├── .profile
│ │ ├── Player.js
│ │ └── README
├── 27-07-17
│ ├── README.md
│ ├── fizz-buzz-room1
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ └── number-letter-counts-room2
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
└── 29-06-17
│ ├── README.md
│ ├── fizz-buzz
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
│ └── tennis-refactoring-kata
│ ├── .nvmrc
│ ├── README.md
│ ├── TennisGame1.js
│ ├── TennisTest.html
│ └── TennisTest.js
├── 2018
├── 05-04-2018
│ ├── README.md
│ └── berlin-clock-kata
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 08-03-2018
│ ├── README.md
│ ├── berlin-clock-kata
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
│ └── roman-numerals
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 10-05-2018
│ ├── README.md
│ ├── berlin-clock-kata
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 11-10-2018
│ ├── README.md
│ ├── api-desing-node
│ │ ├── api.test.js
│ │ ├── package-lock.json
│ │ └── package.json
│ └── api-node-imbd
│ │ ├── README.md
│ │ ├── core
│ │ ├── create-movie.js
│ │ └── create-movie.spec.js
│ │ ├── database
│ │ ├── index.js
│ │ └── index.spec.js
│ │ ├── package-lock.json
│ │ └── package.json
├── 13-09-2018
│ ├── README.md
│ ├── api-node-imbd
│ │ ├── README.md
│ │ ├── core
│ │ │ ├── create-movie.js
│ │ │ └── create-movie.spec.js
│ │ └── package.json
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ └── scrabble-score
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 19-04-2018
│ ├── README.md
│ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 22-03-18
│ └── berlin-clock-kata
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 22-03-2018
│ ├── README.md
│ ├── ceasar-shift-cipher
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 24-05-2018
│ ├── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ └── roman-numerals
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 25-10-2018
│ ├── api-node-imbd
│ │ ├── .buildkite
│ │ │ └── pipeline.yml
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── app.js
│ │ ├── buildkite-agent.cfg
│ │ ├── core
│ │ │ ├── create-movie.js
│ │ │ └── create-movie.spec.js
│ │ ├── database
│ │ │ ├── index.js
│ │ │ └── index.spec.js
│ │ ├── docker-compose.yml
│ │ ├── jest.config.js
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── web
│ │ │ ├── index.js
│ │ │ └── index.spec.js
│ ├── banking-kata
│ │ ├── .nvmrc
│ │ ├── Account.js
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
│ └── bowling-game
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
└── 27-09-2018
│ ├── api-node-imbd
│ ├── README.md
│ ├── core
│ │ ├── create-movie.js
│ │ └── create-movie.spec.js
│ ├── package-lock.json
│ └── package.json
│ └── api-node-imdb-2
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ └── test.js
├── 2019
├── 14-Mar-2019
│ └── fizz-buzz
│ │ ├── .nvmrc
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 2019-03-14
│ └── api-node-imbd
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 2019-03-28
│ └── api-node-imbd
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── test.js
├── 2019-04-11
│ ├── api-node-imbd
│ │ ├── README.md
│ │ ├── core
│ │ │ ├── create-movie.js
│ │ │ └── create-movie.test.js
│ │ ├── database
│ │ │ ├── database.js
│ │ │ └── database.test.js
│ │ ├── package-lock.json
│ │ └── package.json
│ └── berlin-clock-kata
│ │ ├── README.md
│ │ ├── package.json
│ │ └── test.js
├── 2019-05-02
│ └── api-node-imbd
│ │ ├── README.md
│ │ ├── core
│ │ ├── create-movie-spy.test.js
│ │ ├── create-movie-stub.test.js
│ │ └── create-movie.js
│ │ ├── database
│ │ ├── database.js
│ │ └── database.test.js
│ │ ├── package-lock.json
│ │ └── package.json
└── 2019-05-16
│ └── wordwrap
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ └── test.js
├── .gitignore
├── CONTRIBUTING.md
├── README.md
├── katas
├── acceptance-tests
│ └── README.md
├── banking-kata
│ ├── .nvmrc
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ └── test.js
├── berlin-clock-kata
│ └── README.md
├── bowling-game
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── ceasar-shift-cipher
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── chess-board
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ └── test.js
├── fizz-buzz
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── gilded-rose-refactoring-kata
│ ├── .nvmrc
│ ├── README.md
│ ├── SpecRunner.html
│ ├── TexttestFixture.html
│ ├── lib
│ │ ├── jasmine-1.1.0
│ │ │ ├── MIT.LICENSE
│ │ │ ├── jasmine-html.js
│ │ │ ├── jasmine.css
│ │ │ ├── jasmine.js
│ │ │ └── jasmine_favicon.png
│ │ ├── jasmine-ajax
│ │ │ └── mock-ajax.js
│ │ ├── jasmine-jquery-1.3.1
│ │ │ └── jasmine-jquery-1.3.1.js
│ │ └── jquery-1.7.1
│ │ │ └── jquery-1.7.1.js
│ ├── package-lock.json
│ ├── package.json
│ ├── spec
│ │ └── gilded_rose_spec.js
│ └── src
│ │ └── gilded_rose.js
├── number-letter-counts
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── palindrome-kata
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── prime-factors
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── roman-numerals
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── scrabble-score
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── sum-of-multiples
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── tennis-refactoring-kata
│ ├── .nvmrc
│ ├── README.md
│ ├── TennisGame1.js
│ ├── TennisTest.html
│ └── TennisTest.js
├── word-wrap
│ ├── .nvmrc
│ ├── README.md
│ ├── package.json
│ └── test.js
├── yatzy-refactoring
│ ├── .nvmrc
│ ├── README.md
│ ├── lib
│ │ └── yatzy.js
│ ├── package.json
│ └── test
│ │ └── yatzy-test.js
└── yatzy
│ ├── .nvmrc
│ ├── README.md
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ └── test.js
├── logo.png
├── logo_muses_color.png
├── slides
├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── LICENSE
├── README.md
├── bower.json
├── css
│ ├── print
│ │ ├── paper.css
│ │ └── pdf.css
│ ├── reveal.css
│ ├── reveal.scss
│ └── theme
│ │ ├── README.md
│ │ ├── beige.css
│ │ ├── black.css
│ │ ├── blood.css
│ │ ├── league.css
│ │ ├── moon.css
│ │ ├── night.css
│ │ ├── serif.css
│ │ ├── simple.css
│ │ ├── sky.css
│ │ ├── solarized.css
│ │ ├── source
│ │ ├── beige.scss
│ │ ├── black.scss
│ │ ├── blood.scss
│ │ ├── league.scss
│ │ ├── moon.scss
│ │ ├── night.scss
│ │ ├── serif.scss
│ │ ├── simple.scss
│ │ ├── sky.scss
│ │ ├── solarized.scss
│ │ └── white.scss
│ │ ├── template
│ │ ├── mixins.scss
│ │ ├── settings.scss
│ │ └── theme.scss
│ │ └── white.css
├── demo.html
├── img
│ ├── kisspng-ninja-computer-programming-learning-study-skills-avatar.png
│ ├── logo.png
│ ├── logo_muses_color.png
│ └── red-green-refactor.jpg
├── index.html
├── js
│ └── reveal.js
├── lib
│ ├── css
│ │ └── zenburn.css
│ ├── font
│ │ ├── league-gothic
│ │ │ ├── LICENSE
│ │ │ ├── league-gothic.css
│ │ │ ├── league-gothic.eot
│ │ │ ├── league-gothic.ttf
│ │ │ └── league-gothic.woff
│ │ └── source-sans-pro
│ │ │ ├── LICENSE
│ │ │ ├── source-sans-pro-italic.eot
│ │ │ ├── source-sans-pro-italic.ttf
│ │ │ ├── source-sans-pro-italic.woff
│ │ │ ├── source-sans-pro-regular.eot
│ │ │ ├── source-sans-pro-regular.ttf
│ │ │ ├── source-sans-pro-regular.woff
│ │ │ ├── source-sans-pro-semibold.eot
│ │ │ ├── source-sans-pro-semibold.ttf
│ │ │ ├── source-sans-pro-semibold.woff
│ │ │ ├── source-sans-pro-semibolditalic.eot
│ │ │ ├── source-sans-pro-semibolditalic.ttf
│ │ │ ├── source-sans-pro-semibolditalic.woff
│ │ │ └── source-sans-pro.css
│ └── js
│ │ ├── classList.js
│ │ ├── head.min.js
│ │ └── html5shiv.js
├── package.json
├── plugin
│ ├── highlight
│ │ └── highlight.js
│ ├── markdown
│ │ ├── example.html
│ │ ├── example.md
│ │ ├── markdown.js
│ │ └── marked.js
│ ├── math
│ │ └── math.js
│ ├── multiplex
│ │ ├── client.js
│ │ ├── index.js
│ │ ├── master.js
│ │ └── package.json
│ ├── notes-server
│ │ ├── client.js
│ │ ├── index.js
│ │ └── notes.html
│ ├── notes
│ │ ├── notes.html
│ │ └── notes.js
│ ├── print-pdf
│ │ └── print-pdf.js
│ ├── search
│ │ └── search.js
│ └── zoom-js
│ │ └── zoom.js
└── test
│ ├── examples
│ ├── assets
│ │ ├── image1.png
│ │ └── image2.png
│ ├── barebones.html
│ ├── embedded-media.html
│ ├── math.html
│ ├── slide-backgrounds.html
│ └── slide-transitions.html
│ ├── qunit-2.5.0.css
│ ├── qunit-2.5.0.js
│ ├── simple.md
│ ├── test-markdown-element-attributes.html
│ ├── test-markdown-element-attributes.js
│ ├── test-markdown-external.html
│ ├── test-markdown-external.js
│ ├── test-markdown-options.html
│ ├── test-markdown-options.js
│ ├── test-markdown-slide-attributes.html
│ ├── test-markdown-slide-attributes.js
│ ├── test-markdown.html
│ ├── test-markdown.js
│ ├── test-pdf.html
│ ├── test-pdf.js
│ ├── test.html
│ └── test.js
└── streams
└── api-node-imbd
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .vscode/
3 | .DS_Store
4 |
--------------------------------------------------------------------------------
/2017/01-06-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Group 1: Fizz Buzz, Group 2: Bowling Game and Group 3: Bowling Game
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 01/06/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game-OldTeam/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game-OldTeam/README.md:
--------------------------------------------------------------------------------
1 | # Bowling Game
2 |
3 | ## Problem Description
4 |
5 | [bowling-score]: http://www.wpclipart.com/recreation/sports/bowling/bowling_scoresheet_example.png "bowling score card"
6 |
7 | ![Bowling scoreboard][bowling-score]
8 |
9 | The game consists of 10 frames as shown above. In each frame the player has
10 | two opportunities to knock down 10 pins. The score for the frame is the total
11 | number of pins knocked down, plus bonuses for strikes and spares.
12 |
13 | A spare is when the player knocks down all 10 pins in two tries. The bonus for
14 | that frame is the number of pins knocked down by the next roll. So in frame 3
15 | above, the score is 10 (the total number knocked down) plus a bonus of 5 (the
16 | number of pins knocked down on the next roll.)
17 |
18 | A strike is when the player knocks down all 10 pins on his first try. The bonus
19 | for that frame is the value of the next two balls rolled.
20 |
21 | In the tenth frame a player who rolls a spare or strike is allowed to roll the extra
22 | balls to complete the frame. However no more than three balls can be rolled in
23 | tenth frame.
24 |
25 |
26 | ## The requirements
27 |
28 | * Write class "BowlingGame" that has two methods
29 | - *roll(pins)*
30 | - called each time the player rolls a ball. The argument is the number of pins knocked down.
31 | - *score()*
32 | - called only after the very end of the game. Returns total score of the game.
33 |
34 | From: https://github.com/hontas/bowling-game-kata
35 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game-OldTeam/index.js:
--------------------------------------------------------------------------------
1 | class BowlingGame {
2 | constructor() {
3 | this.rolls = []
4 | }
5 |
6 | roll(pins) {
7 | this.rolls.push(pins)
8 | }
9 |
10 | score() {
11 | let total = 0
12 | for (var i = 0; i < this.rolls.length; i++) {
13 | total += this.rolls[i]
14 | if ((this.rolls[i]+this.rolls[i+1])===10){
15 | total += this.rolls[i+2]
16 | }
17 | if (this.rolls[i] === 10) {
18 | if (this.rolls[i+1]) {
19 | total += this.rolls[i+1]
20 | }
21 | if (this.rolls[i+2]) {
22 | total += this.rolls[i+2]
23 | }
24 | }
25 | }
26 |
27 | return total
28 | }
29 | }
30 |
31 | module.exports = BowlingGame
32 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game-OldTeam/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bowling-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game/README.md:
--------------------------------------------------------------------------------
1 | # Bowling Game
2 |
3 | ## Problem Description
4 |
5 | [bowling-score]: http://www.wpclipart.com/recreation/sports/bowling/bowling_scoresheet_example.png "bowling score card"
6 |
7 | ![Bowling scoreboard][bowling-score]
8 |
9 | The game consists of 10 frames as shown above. In each frame the player has
10 | two opportunities to knock down 10 pins. The score for the frame is the total
11 | number of pins knocked down, plus bonuses for strikes and spares.
12 |
13 | A spare is when the player knocks down all 10 pins in two tries. The bonus for
14 | that frame is the number of pins knocked down by the next roll. So in frame 3
15 | above, the score is 10 (the total number knocked down) plus a bonus of 5 (the
16 | number of pins knocked down on the next roll.)
17 |
18 | A strike is when the player knocks down all 10 pins on his first try. The bonus
19 | for that frame is the value of the next two balls rolled.
20 |
21 | In the tenth frame a player who rolls a spare or strike is allowed to roll the extra
22 | balls to complete the frame. However no more than three balls can be rolled in
23 | tenth frame.
24 |
25 |
26 | ## The requirements
27 |
28 | * Write class "BowlingGame" that has two methods
29 | - *roll(pins)*
30 | - called each time the player rolls a ball. The argument is the number of pins knocked down.
31 | - *score()*
32 | - called only after the very end of the game. Returns total score of the game.
33 |
34 | From: https://github.com/hontas/bowling-game-kata
35 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bowling-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/bowling-game/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | class BowlingGame {
4 | constructor(){
5 | this.counter = 0;
6 | this.numberofplaying = 0;
7 | };
8 |
9 | roll(pins) {
10 | this.counter += pins;
11 | this.numberofplaying++;
12 | };
13 |
14 | get score() {
15 | return this.counter;
16 | }
17 | };
18 |
19 | describe('Bowling Game', () => {
20 |
21 | it('keeps score each 1 roll', () => {
22 | const game = new BowlingGame();
23 | const expected = 3;
24 | game.roll(3);
25 | const actual = game.score;
26 |
27 | assert.equal(expected, actual);
28 | });
29 |
30 | it('keeps score 2 rolls', () => {
31 | const game = new BowlingGame();
32 | const expected = 5;
33 | game.roll(2);
34 | game.roll(3);
35 | const actual = game.score;
36 |
37 | assert.equal(actual, expected);
38 | });
39 |
40 | it('keeps score for a full game without strike and spare', () => {
41 | const game = new BowlingGame();
42 | const expected = 40;
43 | for (var i = 0; i < 20; i++) {
44 | game.roll(2);
45 | };
46 | const actual = game.score;
47 |
48 | assert.equal(actual, expected);
49 | });
50 |
51 | it('Rule of spare', () => {
52 |
53 | const game = new BowlingGame();
54 | const expected = 16;
55 | game.roll(8);
56 | game.roll(2);
57 | game.roll(3);
58 | const actual = game.score;
59 |
60 | assert.equal(actual, expected);
61 | });
62 |
63 |
64 | });
65 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/01-06-17/katas/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | fizzbuzz = (number) => {
4 | if (number % 15 == 0){
5 | return "FizzBuzz"
6 | }
7 | if (number % 3 == 0){
8 | return "Fizz"
9 | }
10 | if (number % 5 == 0){
11 | return "Buzz"
12 | }
13 | return number
14 | }
15 |
16 | function fizzbuzzupto(number) {
17 | if (number == 1) {
18 | for (i = 1; i <= 1; i++) {
19 | return [fizzbuzz(i)]
20 | }
21 | }
22 | if (number == 2) {
23 | for (i = 1; i <= number; i++) {
24 | return [fizzbuzz(i), fizzbuzz(number)]
25 | }
26 | }
27 | if (number == 3) {
28 | return [fizzbuzz(1), fizzbuzz(2), fizzbuzz(number)]
29 | }
30 | if (number == 4) {
31 | return [fizzbuzz(1), fizzbuzz(2), fizzbuzz(3), fizzbuzz(number)]
32 | }
33 | }
34 |
35 | describe('FizzBuzz', function () {
36 | it('returns a number', function () {
37 | assert.equal(fizzbuzz(1), 1)
38 | assert.equal(fizzbuzz(2), 2)
39 | assert.equal(fizzbuzz(4), 4)
40 | assert.equal(fizzbuzz(7), 7)
41 | });
42 | it('returns a Fizz for multiples of 3', function () {
43 | assert.equal(fizzbuzz(3), "Fizz")
44 | assert.equal(fizzbuzz(6), "Fizz")
45 | assert.equal(fizzbuzz(9), "Fizz")
46 | });
47 | it('returns a Buzz for multiples of 5', function () {
48 | assert.equal(fizzbuzz(5), "Buzz")
49 | assert.equal(fizzbuzz(10), "Buzz")
50 | });
51 | it('returns a FizzBuzz for multiples of 5 and 3', function () {
52 | assert.equal(fizzbuzz(15), "FizzBuzz")
53 | assert.equal(fizzbuzz(30), "FizzBuzz")
54 | assert.equal(fizzbuzz(45), "FizzBuzz")
55 | });
56 | it('input returns an array of Fizzbuzzes up to number', function() {
57 | assert.deepEqual(fizzbuzzupto(1),[1])
58 | assert.deepEqual(fizzbuzzupto(2),[1,2])
59 | assert.deepEqual(fizzbuzzupto(3),[1,2,"Fizz"])
60 | assert.deepEqual(fizzbuzzupto(4),[1,2,"Fizz", 4])
61 | });
62 | });
63 |
--------------------------------------------------------------------------------
/2017/04-05-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and Roman Numerals
3 | * **Where:** [TabCorp](https://www.tabcorp.com.au/)
4 | * **When:** 04/05/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/04-05-17/katas/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/04-05-17/katas/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/04-05-17/katas/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | const fizzBuzz = (num) => {
4 | if (num % 3 === 0 && num % 5 ===0) {
5 | return 'FizzBuzz';
6 | } else if (num % 3 === 0) {
7 | return 'Fizz';
8 | } else if (num % 5 === 0) {
9 | return 'Buzz';
10 | }
11 | return num;
12 | }
13 |
14 | const FizzBuzz1 = (num) => {
15 | return [1,2]
16 | }
17 |
18 | describe('Fizz Buzz', function() {
19 |
20 | it('returns 1 for 1', () => {
21 | const expected = 1;
22 | const actual = fizzBuzz(1);
23 | assert.equal(expected, actual);
24 | });
25 |
26 | it('return 2 for 2', () => {
27 | const expected = 2;
28 | const actual = fizzBuzz(2);
29 | assert.equal(expected, actual);
30 | });
31 |
32 | it('is a multiple of 3', () => {
33 | const expected = 'Fizz';
34 | const actual = fizzBuzz(3);
35 | assert.equal(expected, actual);
36 | });
37 |
38 | it('returns Buzz for multiple of 5 ', () => {
39 | const expected = 'Buzz';
40 | const actual = fizzBuzz(5);
41 | assert.equal(expected, actual);
42 | });
43 |
44 | it('returns FizzBuzz for multiple of 3 and 5', () => {
45 | const expected = 'FizzBuzz';
46 |
47 | const actual = fizzBuzz(30);
48 | assert.equal(expected, actual);
49 | });
50 |
51 | it('returns Generalized FizzBuzz for multiple of 3 and 5', () => {
52 | assert.deepEqual([1], FizzBuzz1(1));
53 | assert.deepEqual([1,2], FizzBuzz1(2));
54 |
55 | });
56 |
57 |
58 | });
59 |
--------------------------------------------------------------------------------
/2017/04-05-17/katas/roman-numerals/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/04-05-17/katas/roman-numerals/README.md:
--------------------------------------------------------------------------------
1 | # Roman Numerals
2 |
3 | ## Problem Description
4 |
5 | The Romans were a clever bunch. They conquered most of Europe and ruled it for
6 | hundreds of years. They invented concrete and straight roads and even bikinis.
7 | One thing they never discovered though was the number zero. This made writing
8 | and dating extensive histories of their exploits slightly more challenging, but
9 | the system of numbers they came up with is still in use today. For example the
10 | BBC uses Roman numerals to date their programmes.
11 |
12 | The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice these
13 | letters have lots of straight lines and are hence easy to hack into stone
14 | tablets).
15 |
16 | The Kata says you should write a function to convert from normal numbers to
17 | Roman Numerals. E.g.:
18 |
19 | 1 -> I
20 | 10 -> X
21 | 7 -> VII
22 |
23 | For a full description of how it works, take a look at
24 | https://en.wikipedia.org/wiki/Roman_numerals
25 |
26 | There is no need to be able to convert numbers larger than about 3000 (the
27 | Romans themselves didn't tend to go any higher). Note that you can't write
28 | numerals like "IM" for 999. Wikipedia says: Modern Roman numerals (…) are
29 | written by expressing each digit separately starting with the left most digit
30 | and skipping any digit with a value of zero. To see this in practice, consider
31 | the (…) example of 1990. In Roman numerals 1990 is rendered: 1000=M, 900=CM,
32 | 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII.
33 |
34 | Here are a few more examples you can use as test cases:
35 |
36 | 1954 -> MCMLIV
37 | 1990 -> MCMXC
38 | 2014 -> MMXIV
39 |
40 | # Extension:
41 |
42 | Write a function to convert in the other direction, i.e. numeral to digit.
43 |
44 | From: http://codingdojo.org/kata/RomanNumerals/
45 |
--------------------------------------------------------------------------------
/2017/04-05-17/katas/roman-numerals/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "roman-numerals",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/05-10-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and JS Warrior Game
3 | * **Where:** [TabCorp](www.tabcorp.com.au)
4 | * **When:** 05/10/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/05-10-17/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/05-10-17/fizz-buzz/README.md:
--------------------------------------------------------------------------------
1 | # Fizz Buzz
2 |
3 | ## Problem Description
4 |
5 | Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more “fun” by introducing a “game”. He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The “fun” part is that if the number is divisible by three, you instead say “Fizz” and if it is divisible by five you say “Buzz”. So now your maths teacher is pointing at all of your classmates in turn, and they happily shout “one!”, “two!”, “Fizz!”, “four!”, “Buzz!”… until he very deliberately points at you, fixing you with a steely gaze… time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak “Fizz!”. Doom is avoided, and the pointing finger moves on.
6 |
7 | So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!
8 |
9 | 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 “.
10 |
11 | Sample output:
12 |
13 | ```
14 | 1
15 | 2
16 | Fizz
17 | 4
18 | Buzz
19 | Fizz
20 | 7
21 | 8
22 | Fizz
23 | Buzz
24 | 11
25 | Fizz
26 | 13
27 | 14
28 | FizzBuzz
29 | 16
30 | 17
31 | Fizz
32 | 19
33 | Buzz
34 | ... etc up to 100
35 | ```
36 |
37 | Stage 2 - new requirements
38 |
39 | ```
40 | * A number is fizz if it is divisible by 3 or if it has a 3 in it
41 | * A number is buzz if it is divisible by 5 or if it has a 5 in it
42 | ```
43 |
44 | From: http://codingdojo.org/kata/FizzBuzz/
45 |
--------------------------------------------------------------------------------
/2017/05-10-17/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/05-10-17/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | let printNumber = (number)=>{
4 |
5 | if (number%5 == 0 && number%3 == 0) {
6 | return "FizzBuzz";
7 | }
8 |
9 | if (number%5 == 0){
10 | return "Buzz";
11 | }
12 |
13 | if (number%3 == 0){
14 | return 'Fizz'
15 | }
16 | return number
17 | };
18 |
19 |
20 | describe('Fizz Buzz Game', function() {
21 |
22 |
23 | it('Returns a number when Given a number', () => {
24 | assert.equal(printNumber(1), 1);
25 | assert.equal(printNumber(2), 2);
26 |
27 | assert.equal(printNumber(4), 4);
28 |
29 |
30 | });
31 |
32 | it('Returns Fizz when number is divisible by 3', () => {
33 | assert.equal(printNumber(3), 'Fizz');
34 | assert.equal(printNumber(6), 'Fizz');
35 | assert.equal(printNumber(9), 'Fizz');
36 |
37 | });
38 |
39 | it('Returns Buzz when given a number divisible by 5', () => {
40 | assert.equal(printNumber(5), 'Buzz');
41 | assert.equal(printNumber(10), 'Buzz');
42 | });
43 |
44 | it('Returns FizzBuzz when given a number divisible by 3 and 5', () => {
45 | assert.equal(printNumber(15), 'FizzBuzz');
46 |
47 | });
48 | });
49 |
50 |
51 |
--------------------------------------------------------------------------------
/2017/07-09-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Tennis Refactoring kata and Fizz Buzz Kata
3 | * **Where:** COLAB Zone
4 | * **When:** 07/09/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/07-09-17/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/07-09-17/fizz-buzz/README.md:
--------------------------------------------------------------------------------
1 | # Fizz Buzz
2 |
3 | ## Problem Description
4 |
5 | Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more “fun” by introducing a “game”. He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The “fun” part is that if the number is divisible by three, you instead say “Fizz” and if it is divisible by five you say “Buzz”. So now your maths teacher is pointing at all of your classmates in turn, and they happily shout “one!”, “two!”, “Fizz!”, “four!”, “Buzz!”… until he very deliberately points at you, fixing you with a steely gaze… time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak “Fizz!”. Doom is avoided, and the pointing finger moves on.
6 |
7 | So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!
8 |
9 | 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 “.
10 |
11 | Sample output:
12 |
13 | ```
14 | 1
15 | 2
16 | Fizz
17 | 4
18 | Buzz
19 | Fizz
20 | 7
21 | 8
22 | Fizz
23 | Buzz
24 | 11
25 | Fizz
26 | 13
27 | 14
28 | FizzBuzz
29 | 16
30 | 17
31 | Fizz
32 | 19
33 | Buzz
34 | ... etc up to 100
35 | ```
36 |
37 | Stage 2 - new requirements
38 |
39 | ```
40 | * A number is fizz if it is divisible by 3 or if it has a 3 in it
41 | * A number is buzz if it is divisible by 5 or if it has a 5 in it
42 | ```
43 |
44 | From: http://codingdojo.org/kata/FizzBuzz/
45 |
--------------------------------------------------------------------------------
/2017/07-09-17/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/07-09-17/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | function fizzBuzz(x) {
4 | if (x % 3 === 0 && x % 5 === 0) {
5 | return "fizzbuzz";
6 | }
7 | if (x%3 === 0){
8 | return "fizz";
9 | }
10 | if (x % 5 === 0) {
11 | return "buzz";
12 | }
13 |
14 | return x;
15 | }
16 |
17 | function computePrint(x) {
18 | let numberArray = [];
19 | let i = 1;
20 |
21 | for (i; i <= x; i+=1) {`1`
22 | numberArray.push(fizzBuzz(i));
23 | }
24 |
25 | return numberArray;
26 | }
27 |
28 | describe('Fizz Buzz Game', function() {
29 |
30 | it('returns fizz for numbers divisible by 3', () => {
31 |
32 | assert.equal(fizzBuzz(3), "fizz");
33 | assert.equal(fizzBuzz(6), "fizz");
34 | assert.equal(fizzBuzz(9), "fizz");
35 |
36 | });
37 |
38 | it('returns buzz for numbers divisible by 5', () => {
39 |
40 | assert.equal(fizzBuzz(5), "buzz");
41 | assert.equal(fizzBuzz(10), "buzz");
42 | assert.equal(fizzBuzz(20), "buzz");
43 |
44 | });
45 |
46 | it('returns fizzbuzz for numbers divisible by 3 and 5', () => {
47 |
48 | assert.equal(fizzBuzz(15), "fizzbuzz");
49 | assert.equal(fizzBuzz(30), "fizzbuzz");
50 |
51 | });
52 |
53 | it('returns number for numbers indivisible by 3 and 5', () => {
54 |
55 | assert.equal(fizzBuzz(1), 1);
56 | assert.equal(fizzBuzz(2), 2);
57 |
58 | });
59 |
60 | it("returns [1] for 1", () => {
61 | assert.deepEqual(computePrint(1), [1]);
62 | });
63 |
64 | it("returns [1, 2] for 2", () => {
65 | assert.deepEqual(computePrint(2), [1, 2]);
66 | });
67 |
68 | it("returns [1, 2, 'fizz'] for 3", () => {
69 | assert.deepEqual(computePrint(3), [1, 2, 'fizz']);
70 | });
71 |
72 | it("returns [1, 2, 'fizz', 4, 'buzz'] for 5", () => {
73 | assert.deepEqual(computePrint(5), [1, 2, 'fizz', 4, 'buzz']);
74 | });
75 | });
76 |
--------------------------------------------------------------------------------
/2017/07-09-17/tennis-refactoring-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/07-09-17/tennis-refactoring-kata/TennisGame1.js:
--------------------------------------------------------------------------------
1 | var TennisGame1 = function(player1Name, player2Name) {
2 | this.m_score1 = 0;
3 | this.m_score2 = 0;
4 | this.player1Name = player1Name;
5 | this.player2Name = player2Name;
6 | };
7 |
8 | TennisGame1.prototype.wonPoint = function(playerName) {
9 | if (playerName === "player1")
10 | this.m_score1 += 1;
11 | else
12 | this.m_score2 += 1;
13 | };
14 |
15 | var getEqualScore = function(score){
16 | var scoreDescriptions = {
17 | 0: "Love-All",
18 | 1: "Fifteen-All",
19 | 2: "Thirty-All"
20 | }
21 | score = scoreDescriptions[score] || "Deuce";
22 | return score;
23 | }
24 |
25 | var getRunningScore = function (score1, score2) {
26 | var runningScore = {
27 | 0: "Love",
28 | 1: "Fifteen",
29 | 2: "Thirty",
30 | 3: "Forty"
31 | }
32 | score = runningScore[score1] + "-" + runningScore[score2];
33 | return score;
34 | }
35 | TennisGame1.prototype.getScore = function() {
36 | var score = "";
37 | var equalScore = this.m_score1 === this.m_score2;
38 | var advantageOrWinScore = this.m_score1 >= 4 || this.m_score2 >= 4;
39 | var tempScore = 0;
40 | if (equalScore) {
41 | score = getEqualScore(this.m_score1);
42 | } else if (advantageOrWinScore) {
43 | var minusResult = this.m_score1 - this.m_score2;
44 | if (minusResult === 1) score = "Advantage player1";
45 | else if (minusResult === -1) score = "Advantage player2";
46 | else if (minusResult >= 2) score = "Win for player1";
47 | else score = "Win for player2";
48 | } else {
49 | score = getRunningScore(this.m_score1,this.m_score2);
50 | }
51 | return score;
52 | };
53 |
54 | if (typeof window === "undefined") {
55 | module.exports = TennisGame1;
56 | }
57 |
--------------------------------------------------------------------------------
/2017/07-09-17/tennis-refactoring-kata/TennisTest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tennis Test
4 |
5 |
6 | Tests incomplete
7 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/2017/10-08-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Banking Kata (2 groups) and Number Letter Counts
3 | * **Where:** COLAB Zone
4 | * **When:** 10/08/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-1/.nvmrc:
--------------------------------------------------------------------------------
1 | 8
2 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-1/README.md:
--------------------------------------------------------------------------------
1 | # Banking Kata
2 |
3 | ## Problem Description
4 |
5 | Your bank is tired of its mainframe COBOL accounting software and they hired both of you for a greenfield project in - what a happy coincidence: your favorite programming language!
6 |
7 | Your task is to show them that your TDD-fu and your new-age programming language can cope with good ole’ COBOL!
8 |
9 | #### Requirements
10 |
11 | Write a class `Account` that offers the following methods:
12 |
13 | ```
14 | void deposit(int)
15 | void withdraw(int)
16 | String printStatement()
17 | ```
18 |
19 | An example statement would be:
20 |
21 | ```
22 | Date Amount Balance
23 | 24.12.2015 +500 500
24 | 23.8.2016 -100 400
25 | ```
26 |
27 | From: http://kata-log.rocks/banking-kata
28 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "banking-kata",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-1/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | var balance = 0;
4 |
5 | const withdraw =(amount) => {
6 | balance -= amount;
7 | };
8 |
9 | const getbalance =() => {
10 | return balance;
11 | };
12 |
13 | const deposit = (amount) => {
14 | balance += amount;
15 | };
16 |
17 |
18 | describe('Banking Kata', () => {
19 | describe('depositing', () => {
20 | it('credits the given amount to our account', () => {
21 | balance = 0;
22 | deposit(0);
23 | assert.equal(getbalance(),0);
24 | });
25 |
26 | it('deposit 1 gives 1', () => {
27 | balance = 0;
28 | deposit(1);
29 | assert.equal(getbalance(),1);
30 | });
31 |
32 | it('adds to the balance', () => {
33 | balance = 0;
34 | deposit(1);
35 | deposit(2);
36 | assert.equal(getbalance(), 3);
37 | });
38 | });
39 |
40 | describe('withdrawal', () => {
41 | it('withdraws the specified amount', () => {
42 | balance = 0;
43 | withdraw(0);
44 | assert.equal(getbalance(), 0);
45 | });
46 |
47 | it('deducts from the balance', () => {
48 | balance = 1;
49 | withdraw(1);
50 | assert.equal(getbalance(), 0);
51 | });
52 | });
53 | });
54 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-2/.nvmrc:
--------------------------------------------------------------------------------
1 | 8
2 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-2/README.md:
--------------------------------------------------------------------------------
1 | # Banking Kata
2 |
3 | ## Problem Description
4 |
5 | Your bank is tired of its mainframe COBOL accounting software and they hired both of you for a greenfield project in - what a happy coincidence: your favorite programming language!
6 |
7 | Your task is to show them that your TDD-fu and your new-age programming language can cope with good ole’ COBOL!
8 |
9 | #### Requirements
10 |
11 | Write a class `Account` that offers the following methods:
12 |
13 | ```
14 | void deposit(int)
15 | void withdraw(int)
16 | String printStatement()
17 | ```
18 |
19 | An example statement would be:
20 |
21 | ```
22 | Date Amount Balance
23 | 24.12.2015 +500 500
24 | 23.8.2016 -100 400
25 | ```
26 |
27 | From: http://kata-log.rocks/banking-kata
28 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "banking-kata",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/10-08-17/banking-kata-group-2/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | let account = [];
3 | account.push('Date Amount Balance');
4 |
5 | const printStatement = () => {
6 | return account.join('\n');
7 | };
8 |
9 | const deposit = n => {
10 | account.push('24.12.2015 +500 500');
11 | };
12 | describe('Banking Kata', () => {
13 | it('prints the statement', () => {
14 | const expected = 'Date Amount Balance';
15 | const actual = printStatement();
16 | assert.equal(actual, expected);
17 | });
18 |
19 | it('prints deposit', () => {
20 | const expected = `Date Amount Balance\n24.12.2015 +500 500`;
21 | deposit();
22 | const actual = printStatement();
23 | assert.equal(actual, expected);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/2017/10-08-17/number-letter-counts/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/10-08-17/number-letter-counts/README.md:
--------------------------------------------------------------------------------
1 | # Number Letter Counts
2 |
3 | ## Problem Description
4 |
5 |
6 |
7 | If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
8 |
9 | Stage 1 - requirements
10 | ```
11 | If all the numbers from 1 to 50 (fifty) inclusive were written out in words, how many letters would be used?
12 | ```
13 |
14 | Stage 2 - requirements
15 | ```
16 | If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
17 | ```
18 |
19 | NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
20 |
21 |
22 | From: https://projecteuler.net/
23 |
--------------------------------------------------------------------------------
/2017/10-08-17/number-letter-counts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "number-letter-counts",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/13-07-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and Roman Numerals
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 13/07/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/13-07-17/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/13-07-17/fizz-buzz/README.md:
--------------------------------------------------------------------------------
1 | # Fizz Buzz
2 |
3 | ## Problem Description
4 |
5 | Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more “fun” by introducing a “game”. He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The “fun” part is that if the number is divisible by three, you instead say “Fizz” and if it is divisible by five you say “Buzz”. So now your maths teacher is pointing at all of your classmates in turn, and they happily shout “one!”, “two!”, “Fizz!”, “four!”, “Buzz!”… until he very deliberately points at you, fixing you with a steely gaze… time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak “Fizz!”. Doom is avoided, and the pointing finger moves on.
6 |
7 | So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!
8 |
9 | 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 “.
10 |
11 | Sample output:
12 |
13 | ```
14 | 1
15 | 2
16 | Fizz
17 | 4
18 | Buzz
19 | Fizz
20 | 7
21 | 8
22 | Fizz
23 | Buzz
24 | 11
25 | Fizz
26 | 13
27 | 14
28 | FizzBuzz
29 | 16
30 | 17
31 | Fizz
32 | 19
33 | Buzz
34 | ... etc up to 100
35 | ```
36 |
37 | Stage 2 - new requirements
38 |
39 | ```
40 | * A number is fizz if it is divisible by 3 or if it has a 3 in it
41 | * A number is buzz if it is divisible by 5 or if it has a 5 in it
42 | ```
43 |
44 | From: http://codingdojo.org/kata/FizzBuzz/
45 |
--------------------------------------------------------------------------------
/2017/13-07-17/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/13-07-17/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | //const Numbers = ()
3 | const FizzBuzz = (number) => {
4 | if(number %3 ===0 && number %5 ===0)
5 | {
6 | return 'FizzBuzz'
7 | } else if(number %5 ===0){
8 | return 'Buzz'
9 | }else if(number %3 ===0){
10 | return 'Fizz'
11 | }else{
12 | return number
13 | }
14 | }
15 |
16 |
17 | describe('Fizz Buzz Game', function() {
18 |
19 | it('if 3 then Fizz', () => {
20 | const expected = 'Fizz';
21 | const actual = FizzBuzz(3);
22 |
23 | assert.equal(actual, expected);
24 | });
25 |
26 | it('if 5 then Buzz', () => {
27 | const expected = 'Buzz';
28 | const actual = FizzBuzz(5);
29 |
30 | assert.equal(actual, expected);
31 | });
32 |
33 | it('if 6 then Fizz', () => {
34 | const expected = 'Fizz';
35 | const actual = FizzBuzz(6);
36 |
37 | assert.equal(actual, expected);
38 | });
39 |
40 | it('if 15 then FizzBuzz', () => {
41 | const expected = 'FizzBuzz';
42 | const actual = FizzBuzz(15);
43 |
44 | assert.equal(actual, expected);
45 | });
46 | it('if 7 then 7', () => {
47 | const expected = 7;
48 | const actual = FizzBuzz(7);
49 |
50 | assert.equal(actual, expected);
51 | });
52 | it('if 21 then Fizz', () => {
53 | const expected = 'Fizz';
54 | const actual = FizzBuzz(21);
55 |
56 | assert.equal(actual, expected);
57 | });
58 | it('if 30 then FizzBuzz', () => {
59 | const expected = 'FizzBuzz';
60 | const actual = FizzBuzz(30);
61 |
62 | assert.equal(actual, expected);
63 | });
64 | for(var i=1;i<=100;i++){
65 | console.log(FizzBuzz(i));
66 | }
67 |
68 |
69 | });
70 |
--------------------------------------------------------------------------------
/2017/13-07-17/roman-numerals/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/13-07-17/roman-numerals/README.md:
--------------------------------------------------------------------------------
1 | # Roman Numerals
2 |
3 | ## Problem Description
4 |
5 | The Romans were a clever bunch. They conquered most of Europe and ruled it for
6 | hundreds of years. They invented concrete and straight roads and even bikinis.
7 | One thing they never discovered though was the number zero. This made writing
8 | and dating extensive histories of their exploits slightly more challenging, but
9 | the system of numbers they came up with is still in use today. For example the
10 | BBC uses Roman numerals to date their programmes.
11 |
12 | The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice these
13 | letters have lots of straight lines and are hence easy to hack into stone
14 | tablets).
15 |
16 | The Kata says you should write a function to convert from normal numbers to
17 | Roman Numerals. E.g.:
18 |
19 | 1 -> I
20 | 10 -> X
21 | 7 -> VII
22 | 50 -> L
23 | 100 -> C
24 | 500 -> D
25 | 1000 -> M
26 |
27 | For a full description of how it works, take a look at
28 | https://en.wikipedia.org/wiki/Roman_numerals
29 |
30 | There is no need to be able to convert numbers larger than about 3000 (the
31 | Romans themselves didn't tend to go any higher). Note that you can't write
32 | numerals like "IM" for 999. Wikipedia says: Modern Roman numerals (…) are
33 | written by expressing each digit separately starting with the left most digit
34 | and skipping any digit with a value of zero. To see this in practice, consider
35 | the (…) example of 1990. In Roman numerals 1990 is rendered: 1000=M, 900=CM,
36 | 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII.
37 |
38 | Here are a few more examples you can use as test cases:
39 |
40 | 1954 -> MCMLIV
41 | 1990 -> MCMXC
42 | 2014 -> MMXIV
43 |
44 | # Extension:
45 |
46 | Write a function to convert in the other direction, i.e. numeral to digit.
47 |
48 | From: http://codingdojo.org/kata/RomanNumerals/
49 |
--------------------------------------------------------------------------------
/2017/13-07-17/roman-numerals/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "roman-numerals",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/13-07-17/roman-numerals/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | function convertNum(num) {
4 | var n = "";
5 | var romanNumeral = {
6 | 1: "I",
7 | 5: "V",
8 | 10: "X"
9 | }
10 |
11 | if (num == 20 || num == 30) {
12 | n= partnerNum(num, 10);
13 | } else if (num <= 3) {
14 | n= partnerNum(num, 1);
15 | }
16 | return n || romanNumeral[num];
17 |
18 | function partnerNum(input, romanKey) {
19 | var n = "";
20 | for (var i = input; i > 0; i -= romanKey) {
21 | n += romanNumeral[romanKey];
22 | }
23 | return n;
24 | }
25 | }
26 | describe('Roman Numerals', function() {
27 |
28 | it('Print I', () => {
29 | const expected = "I";
30 | const actual = convertNum(1);
31 |
32 | assert.equal(actual, expected);
33 | });
34 |
35 | it('Print V', () => {
36 | const expected = "V";
37 | const actual = convertNum(5);
38 |
39 | assert.equal(actual, expected);
40 | });
41 |
42 | it('Print X', () => {
43 | const expected = "X";
44 | const actual = convertNum(10);
45 |
46 | assert.equal(actual, expected);
47 | });
48 |
49 | it('Print II', () => {
50 | const expected = "II";
51 | const actual = convertNum(2);
52 |
53 | assert.equal(actual, expected);
54 | });
55 | it('Print XX', () => {
56 | const expected = "XX";
57 | const actual = convertNum(20);
58 |
59 | assert.equal(actual, expected);
60 | });
61 | it('Print XXX', () => {
62 | const expected = "XXX";
63 | const actual = convertNum(30);
64 |
65 | assert.equal(actual, expected);
66 | });
67 | it('Print III', () => {
68 | const expected = "III";
69 | const actual = convertNum(3);
70 |
71 | assert.equal(actual, expected);
72 | });
73 | });
74 |
--------------------------------------------------------------------------------
/2017/15-06-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and Tennis Refactoring Kata
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 15/06/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/15-06-17/katas/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/15-06-17/katas/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/15-06-17/katas/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | const shoutFizzBuzz = function(num) {
4 | if (num % 3 == 0 && num % 5 == 0)
5 | return 'FizzBuzz';
6 | else if (num % 3 == 0)
7 | return 'Fizz';
8 | else if (num % 5 == 0)
9 | return 'Buzz';
10 | return num;
11 | }
12 |
13 | describe('FizzBuzz', function() {
14 |
15 | it('prints number can not be divided by 3 and 5', () => {
16 | assert.equal(shoutFizzBuzz(1), 1);
17 | assert.equal(shoutFizzBuzz(2), 2);
18 | });
19 |
20 | it('prints Fizz when number divisible by 3', () => {
21 | const expected = 'Fizz';
22 | assert.equal(shoutFizzBuzz(3), expected);
23 | assert.equal(shoutFizzBuzz(6), expected);
24 | assert.equal(shoutFizzBuzz(9), expected);
25 | });
26 |
27 | it('prints Buzz when number divisible by 5', () => {
28 | const expected = 'Buzz';
29 | assert.equal(shoutFizzBuzz(5), expected);
30 | assert.equal(shoutFizzBuzz(10), expected);
31 | });
32 |
33 | it('prints FizzBuzz when number divisible by 3 and 5', () => {
34 | const expected = 'FizzBuzz';
35 | assert.equal(shoutFizzBuzz(15), expected);
36 | assert.equal(shoutFizzBuzz(30), expected);
37 | });
38 |
39 | it('prints sequence of numbers', () => {
40 | const expected = 'FizzBuzz';
41 | assert.equal(shoutFizzBuzz(15), expected);
42 | assert.equal(shoutFizzBuzz(30), expected);
43 | });
44 | });
45 |
--------------------------------------------------------------------------------
/2017/15-06-17/tennis-refactoring-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/15-06-17/tennis-refactoring-kata/TennisGame1.js:
--------------------------------------------------------------------------------
1 | var TennisGame1 = function(player1Name, player2Name) {
2 | this.player1Score = 0;
3 | this.player2Score = 0;
4 | this.player1Name = player1Name;
5 | this.player2Name = player2Name;
6 | };
7 |
8 | TennisGame1.prototype.wonPoint = function(playerName) {
9 | if (playerName === this.player1Name)
10 | this.player1Score += 1;
11 | else
12 | this.player2Score += 1;
13 | };
14 |
15 | TennisGame1.prototype.getScore = function() {
16 | var score = "";
17 | var tempScore = 0;
18 |
19 | var tiedScore = {
20 | 0: "Love-All",
21 | 1: "Fifteen-All",
22 | 2: "Thirty-All",
23 | 3: "Deuce"
24 | }
25 | var noTiedScore = {
26 | 0: "Love",
27 | 1: "Fifteen",
28 | 2: "Thirty",
29 | 3: "Forty"
30 | }
31 | var scoresAreTied = () => {
32 | return (this.player1Score === this.player2Score);
33 | }
34 | var playerHasAdvantage = () => {
35 | return (this.player1Score >= 4 || this.player2Score >= 4);
36 | }
37 | if (scoresAreTied()) {
38 | if (this.player1Score >2) {
39 | score = tiedScore[3];
40 | } else{
41 | score = tiedScore[this.player1Score];
42 | }
43 | } else if (playerHasAdvantage()) {
44 | var scoreDifference = this.player1Score - this.player2Score;
45 | if (scoreDifference === 1) score = "Advantage " + this.player1Name;
46 | else if (scoreDifference === -1) score = "Advantage " + this.player2Name;
47 | else if (scoreDifference >= 2) score = "Win for " + this.player1Name;
48 | else score = "Win for " + this.player2Name;
49 | } else {
50 | score = noTiedScore[this.player1Score] + "-" + noTiedScore[this.player2Score];
51 | }
52 | return score;
53 | };
54 |
55 | if (typeof window === "undefined") {
56 | module.exports = TennisGame1;
57 | }
58 |
--------------------------------------------------------------------------------
/2017/15-06-17/tennis-refactoring-kata/TennisTest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tennis Test
4 |
5 |
6 | Tests incomplete
7 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/2017/18-05-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and Bowling Game
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 18/05/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/bowling-game/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/bowling-game/README.md:
--------------------------------------------------------------------------------
1 | # Bowling Game
2 |
3 | ## Problem Description
4 |
5 | [bowling-score]: http://www.wpclipart.com/recreation/sports/bowling/bowling_scoresheet_example.png "bowling score card"
6 |
7 | ![Bowling scoreboard][bowling-score]
8 |
9 | The game consists of 10 frames as shown above. In each frame the player has
10 | two opportunities to knock down 10 pins. The score for the frame is the total
11 | number of pins knocked down, plus bonuses for strikes and spares.
12 |
13 | A spare is when the player knocks down all 10 pins in two tries. The bonus for
14 | that frame is the number of pins knocked down by the next roll. So in frame 3
15 | above, the score is 10 (the total number knocked down) plus a bonus of 5 (the
16 | number of pins knocked down on the next roll.)
17 |
18 | A strike is when the player knocks down all 10 pins on his first try. The bonus
19 | for that frame is the value of the next two balls rolled.
20 |
21 | In the tenth frame a player who rolls a spare or strike is allowed to roll the extra
22 | balls to complete the frame. However no more than three balls can be rolled in
23 | tenth frame.
24 |
25 |
26 | ## The requirements
27 |
28 | * Write class "BowlingGame" that has two methods
29 | - *roll(pins)*
30 | - called each time the player rolls a ball. The argument is the number of pins knocked down.
31 | - *score()*
32 | - called only after the very end of the game. Returns total score of the game.
33 |
34 | From: https://github.com/hontas/bowling-game-kata
35 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/bowling-game/index.js:
--------------------------------------------------------------------------------
1 | class BowlingGame {
2 | constructor() {
3 | this.rolls = []
4 | }
5 |
6 | roll(pins) {
7 | this.rolls.push(pins)
8 | }
9 |
10 | score() {
11 | let total = 0
12 | for (var i = 0; i < this.rolls.length; i++) {
13 | total += this.rolls[i]
14 | if (this.rolls[i] === 10) {
15 | if (this.rolls[i+1]) {
16 | total += this.rolls[i+1]
17 | }
18 | if (this.rolls[i+2]) {
19 | total += this.rolls[i+2]
20 | }
21 | }
22 | }
23 |
24 | return total
25 | }
26 | }
27 |
28 | module.exports = BowlingGame
29 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/bowling-game/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bowling-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/bowling-game/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | const BowlingGame = require('./');
3 |
4 |
5 | describe('Bowling Game', function() {
6 |
7 | it('first two rolls get 0, should return 0', () => {
8 | const bowlingGame = new BowlingGame();
9 | bowlingGame.roll(0);
10 | bowlingGame.roll(0);
11 | const actual = bowlingGame.score();
12 |
13 | assert.equal(actual, 0);
14 | });
15 |
16 | it('first two rolls get 1, should return 1', () => {
17 | const bowlingGame = new BowlingGame();
18 | bowlingGame.roll(0);
19 | bowlingGame.roll(1);
20 | const actual = bowlingGame.score();
21 |
22 | assert.equal(actual, 1);
23 | });
24 |
25 | it('first two roll get one each score, should return 2', () => {
26 | const bowlingGame = new BowlingGame();
27 | bowlingGame.roll(1);
28 | bowlingGame.roll(1);
29 | const actual = bowlingGame.score();
30 |
31 | assert.equal(actual, 2);
32 | });
33 |
34 | it('strike without further pins', () => {
35 | const bowlingGame = new BowlingGame();
36 | bowlingGame.roll(10);
37 | bowlingGame.roll(0);
38 | bowlingGame.roll(0);
39 | const actual = bowlingGame.score();
40 |
41 | assert.equal(actual, 10);
42 | })
43 |
44 | it('strike plus one pin', () => {
45 | const bowlingGame = new BowlingGame();
46 | bowlingGame.roll(10);
47 | bowlingGame.roll(1);
48 | bowlingGame.roll(1);
49 | const actual = bowlingGame.score();
50 |
51 | assert.equal(actual, 12);
52 | })
53 | });
54 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/18-05-17/katas/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | const FizzBuzz = (number) => {
3 | if (number == 0) {
4 | return 0;
5 | }
6 | if (number % 3 == 0 && number % 5 == 0) {
7 | return 'FizzBuzz';
8 | }
9 | if (number % 3 == 0) {
10 | return "Fizz";
11 | }
12 | if (number % 5 == 0) {
13 | return 'Buzz';
14 | }
15 | return number;
16 | }
17 |
18 | const GenericFizzBuzz = (number) => {
19 | if (number == 1) {
20 | return [0,FizzBuzz(number)]
21 | } else if (number == 2) {
22 | return [0, 1, FizzBuzz(number)]
23 | } else if (number == 3) {
24 | return [0, 1, 2, FizzBuzz(number)]
25 | }
26 | return [FizzBuzz(number)]
27 | }
28 |
29 | describe('Fizz Buzz', function() {
30 | it('return the same number when not multiple of 3', () => {
31 | assert.equal(0, FizzBuzz(0));
32 | assert.equal(1, FizzBuzz(1));
33 | assert.equal(4, FizzBuzz(4));
34 | });
35 |
36 | it('return Fizz for multiple of 3', () => {
37 | assert.equal('Fizz', FizzBuzz(3));
38 | assert.equal('Fizz', FizzBuzz(6));
39 | assert.equal('Fizz', FizzBuzz(9));
40 | });
41 |
42 | it('return Buzz for multiple of 5', () => {
43 | assert.equal('Buzz', FizzBuzz(5));
44 | assert.equal('Buzz', FizzBuzz(10));
45 | });
46 |
47 | it('return FizzBuzz for multiples of 3 and 5', () => {
48 | assert.equal('FizzBuzz', FizzBuzz(15));
49 | assert.equal('FizzBuzz', FizzBuzz(30));
50 | });
51 |
52 | describe ('Give an array of numbers', () => {
53 | it ('return the numbers with FizzBuzz rule', () => {
54 | assert.deepEqual([0], GenericFizzBuzz(0));
55 | assert.deepEqual([0, 1], GenericFizzBuzz(1));
56 | assert.deepEqual([0, 1, 2], GenericFizzBuzz(2));
57 | assert.deepEqual([0, 1, 2, 'Fizz'], GenericFizzBuzz(3));
58 | })
59 | })
60 | });
61 |
--------------------------------------------------------------------------------
/2017/24-08-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz, Banking-kata and scrabble score
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 24/08/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/24-08-17/banking-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 8
2 |
--------------------------------------------------------------------------------
/2017/24-08-17/banking-kata/README.md:
--------------------------------------------------------------------------------
1 | # Banking Kata
2 |
3 | ## Problem Description
4 |
5 | Your bank is tired of its mainframe COBOL accounting software and they hired both of you for a greenfield project in - what a happy coincidence: your favorite programming language!
6 |
7 | Your task is to show them that your TDD-fu and your new-age programming language can cope with good ole’ COBOL!
8 |
9 | #### Requirements
10 |
11 | Write a class `Account` that offers the following methods:
12 |
13 | ```
14 | void deposit(int)
15 | void withdraw(int)
16 | String printStatement()
17 | ```
18 |
19 | An example statement would be:
20 |
21 | ```
22 | Date Amount Balance
23 | 24.12.2015 +500 500
24 | 23.8.2016 -100 400
25 | ```
26 |
27 | From: http://kata-log.rocks/banking-kata
28 |
--------------------------------------------------------------------------------
/2017/24-08-17/banking-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "banking-kata",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/24-08-17/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/24-08-17/fizz-buzz/README.md:
--------------------------------------------------------------------------------
1 | # Fizz Buzz
2 |
3 | ## Problem Description
4 |
5 | Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more “fun” by introducing a “game”. He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The “fun” part is that if the number is divisible by three, you instead say “Fizz” and if it is divisible by five you say “Buzz”. So now your maths teacher is pointing at all of your classmates in turn, and they happily shout “one!”, “two!”, “Fizz!”, “four!”, “Buzz!”… until he very deliberately points at you, fixing you with a steely gaze… time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak “Fizz!”. Doom is avoided, and the pointing finger moves on.
6 |
7 | So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!
8 |
9 | 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 “.
10 |
11 | Sample output:
12 |
13 | ```
14 | 1
15 | 2
16 | Fizz
17 | 4
18 | Buzz
19 | Fizz
20 | 7
21 | 8
22 | Fizz
23 | Buzz
24 | 11
25 | Fizz
26 | 13
27 | 14
28 | FizzBuzz
29 | 16
30 | 17
31 | Fizz
32 | 19
33 | Buzz
34 | ... etc up to 100
35 | ```
36 |
37 | Stage 2 - new requirements
38 |
39 | ```
40 | * A number is fizz if it is divisible by 3 or if it has a 3 in it
41 | * A number is buzz if it is divisible by 5 or if it has a 5 in it
42 | ```
43 |
44 | From: http://codingdojo.org/kata/FizzBuzz/
45 |
--------------------------------------------------------------------------------
/2017/24-08-17/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/24-08-17/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | function Fizz(num) {
4 | if (num % 3 === 0 ) {
5 | return "Fizz";
6 | }
7 | else {
8 | return num;
9 | }
10 | }
11 |
12 | function buzz(num) {
13 | if (num % 5 === 0 ) {
14 | return "Buzz";
15 | }
16 | else {
17 | return num;
18 | }
19 | }
20 |
21 | const fizzBuzz = (num) => {
22 | if (num % 3 === 0 && num % 5 === 0) {
23 | return "Fizz Buzz";
24 | } else {
25 | return num;
26 | }
27 | }
28 |
29 | describe('Fizz Buzz Game', function() {
30 |
31 | it('it is divisible by 3 print Fizz', () => {
32 | var num = 3;
33 | const expected = "Fizz";
34 | const actual = Fizz(3);
35 |
36 | assert.equal(actual, expected);
37 | });
38 |
39 | it('it not divisible by 3 print number', () => {
40 | var num = 2;
41 | const expected = num;
42 | const actual = Fizz(num);
43 |
44 | assert.equal(Fizz(num), expected);
45 | assert.equal(buzz(num), expected);
46 | });
47 |
48 | it('if divisible by 5 print buzz', () => {
49 | var num = 5;
50 | const expected = 'Buzz';
51 | const actual = buzz(num);
52 |
53 | assert.equal(actual, expected);
54 |
55 | });
56 | it('if divisible by 3 and 5 print Fizz Buzz', () => {
57 | var num = 15;
58 | const expected = 'Fizz Buzz';
59 | const actual = fizzBuzz(num);
60 |
61 | assert.equal(actual, expected);
62 |
63 | });
64 |
65 | });
66 |
67 |
--------------------------------------------------------------------------------
/2017/24-08-17/scrabble-score/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/24-08-17/scrabble-score/README.md:
--------------------------------------------------------------------------------
1 | # Scrabble Score
2 | Given a word, compute the scrabble score for that word.
3 |
4 | ## Letter Values
5 | You'll need these:
6 | ```
7 | Letter Value
8 | A, E, I, O, U, L, N, R, S, T 1
9 | D, G 2
10 | B, C, M, P 3
11 | F, H, V, W, Y 4
12 | K 5
13 | J, X 8
14 | Q, Z 10
15 | ```
16 | E.g. Javascript should return `24`:
17 | * 8 points for `j`,
18 | * 1 point for `a` twice,
19 | * 4 points for `v`,
20 | * 1 point for `s`,
21 | * 3 points for `c`,
22 | * 1 point for `r`,
23 | * 1 point for `i`,
24 | * 3 points for `p`,
25 | * 1 point for `t`
26 |
27 | Which gives us a total of `24`.
28 |
29 | Inspired from [rchantley's extreme startup game](https://github.com/rchatley/extreme_startup).
30 |
--------------------------------------------------------------------------------
/2017/24-08-17/scrabble-score/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scrabble-scoring-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/25-10-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and JS Warrior Game
3 | * **Where:** [TabCorp](www.tabcorp.com.au)
4 | * **When:** 25/10/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/25-10-17/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/25-10-17/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/25-10-17/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | const divisibleBy = (divisor, number) => number % divisor === 0;
3 | const divisibleBy3 = (number) => divisibleBy(3, number);
4 | const divisibleBy5 = (number) => divisibleBy(5, number);
5 | const divisibleBy15 = (number) => divisibleBy(15, number);
6 |
7 | const fizzBuzz = (number) => {
8 | if (divisibleBy15(number)) {
9 | return 'fizzBuzz';
10 | } else if (divisibleBy3(number)) {
11 | return 'fizz';
12 | } else if (divisibleBy5(number)) {
13 | return 'buzz';
14 | }
15 | return number;
16 | }
17 |
18 | describe('Fizz Buzz Game', function() {
19 |
20 | it('Number not divisible by 3 and 5 returns number', () => {
21 | assert.equal(fizzBuzz(1), 1);
22 | assert.equal(fizzBuzz(2), 2);
23 | assert.equal(fizzBuzz(11), 11);
24 | });
25 |
26 | it('Number divisible by 5 returns "buzz"', () => {
27 | assert.equal(fizzBuzz(5),"buzz");
28 | assert.equal(fizzBuzz(10),"buzz");
29 | });
30 |
31 | it('Number divis by 3 returns "fizz"', () => {
32 | assert.equal(fizzBuzz(3),"fizz");
33 | assert.equal(fizzBuzz(6),"fizz");
34 | assert.equal(fizzBuzz(9),"fizz");
35 | });
36 |
37 | it('Number divisible by 15 returns "fizzBuzz"', () => {
38 | assert.equal(fizzBuzz(15),"fizzBuzz");
39 | assert.equal(fizzBuzz(30),"fizzBuzz");
40 | });
41 |
42 | });
43 |
--------------------------------------------------------------------------------
/2017/25-10-17/warriorjs/.profile:
--------------------------------------------------------------------------------
1 | eyJfdG93ZXJQYXRoIjoiL1VzZXJzL3JvZG9sZm9wcnIvLm52bS92ZXJzaW9ucy9ub2RlL3Y4LjEuNC9saWIvbm9kZV9tb2R1bGVzL3dhcnJpb3Jqcy90b3dlcnMvYmVnaW5uZXIiLCJfd2Fycmlvck5hbWUiOiJ4ZW5hIiwiX3Njb3JlIjoyOTYsIl9lcGljIjpmYWxzZSwiX2VwaWNTY29yZSI6MCwiX2N1cnJlbnRFcGljU2NvcmUiOjAsIl9jdXJyZW50RXBpY0dyYWRlcyI6e30sIl9hdmVyYWdlR3JhZGUiOm51bGwsIl9hYmlsaXRpZXMiOlt7Im5hbWUiOiJ3YWxrIiwiYXJncyI6W119LHsibmFtZSI6ImF0dGFjayIsImFyZ3MiOltdfSx7Im5hbWUiOiJmZWVsIiwiYXJncyI6W119LHsibmFtZSI6ImhlYWx0aCIsImFyZ3MiOltdfSx7Im5hbWUiOiJyZXN0IiwiYXJncyI6W119LHsibmFtZSI6InJlc2N1ZSIsImFyZ3MiOltdfV0sIl9sZXZlbE51bWJlciI6NiwiX2xhc3RMZXZlbE51bWJlciI6bnVsbCwiX3BsYXllclBhdGgiOiIuIn0=
--------------------------------------------------------------------------------
/2017/25-10-17/warriorjs/Player.js:
--------------------------------------------------------------------------------
1 | class Player {
2 | playTurn(warrior) {
3 | let _health = this.health;
4 | // Cool code goes here
5 | //if (warrior.feel().isEmpty() && warrior.health() < _health) {
6 | if (warrior.feel().isCaptive()) {
7 | warrior.rescue();
8 | } else if (
9 | warrior.feel().isEmpty() &&
10 | warrior.health() >= _health &&
11 | warrior.health() < 15
12 | ) {
13 | warrior.rest();
14 | } else if (!warrior.feel().isEmpty()) {
15 | warrior.attack();
16 | } else {
17 | warrior.walk();
18 | }
19 |
20 | this.health = warrior.health();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/2017/25-10-17/warriorjs/README:
--------------------------------------------------------------------------------
1 | Level 6
2 |
3 | The wall behind you feels a bit further away in this room. And you hear more cries for help.
4 |
5 | Tip: You can walk backward by passing `'backward'` as an argument to `walk()`. Same goes for `feel()`, `rescue()` and `attack()`. Archers have a limited attack distance.
6 |
7 |
8 | ╔════════╗
9 | ║C @ S aa║
10 | ╚════════╝
11 |
12 | > = stairs
13 | @ = xena
14 | S = thickSludge
15 | a = archer
16 |
17 |
18 | Warrior abilities:
19 |
20 | warrior.walk()
21 |
22 | warrior.attack()
23 |
24 | warrior.feel()
25 |
26 | warrior.health()
27 |
28 | warrior.rest()
29 |
30 | warrior.rescue()
31 |
32 |
33 | When you're done editing Player.js, run the warriorjs command again.
34 |
--------------------------------------------------------------------------------
/2017/27-07-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and Number Letter Counts
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 27/07/2017
5 |
--------------------------------------------------------------------------------
/2017/27-07-17/fizz-buzz-room1/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/27-07-17/fizz-buzz-room1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/27-07-17/fizz-buzz-room1/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | const returnNumber = (x) => {
3 |
4 | if (x%3 == 0 && x%5 == 0) {
5 | return 'FizzBuzz'
6 | } else if (x%3 == 0) {
7 | return 'Fizz';
8 | } else if (x%5 == 0) {
9 | return 'Buzz';
10 | }
11 | return x;
12 | }
13 |
14 | describe('Fizz buzz game', function() {
15 |
16 | it('returns x for x', () => {
17 | assert.equal(returnNumber(1), 1);
18 | assert.equal(returnNumber(2), 2);
19 | assert.equal(returnNumber(8), 8);
20 | });
21 |
22 | it('returns Fizz for multiples of 3', () => {
23 | assert.equal(returnNumber(3), 'Fizz');
24 | assert.equal(returnNumber(6), 'Fizz');
25 | assert.equal(returnNumber(12), 'Fizz');
26 | });
27 |
28 | it('returns Buzz for multiples of 5', () => {
29 | assert.equal(returnNumber(5), 'Buzz');
30 | assert.equal(returnNumber(10), 'Buzz');
31 | assert.equal(returnNumber(20), 'Buzz');
32 | });
33 |
34 | it('returns FizzBuzz for multiples of 5 and 3', () => {
35 | assert.equal(returnNumber(15), 'FizzBuzz');
36 | assert.equal(returnNumber(30), 'FizzBuzz');
37 | assert.equal(returnNumber(45), 'FizzBuzz');
38 | });
39 |
40 |
41 |
42 |
43 | });
44 |
--------------------------------------------------------------------------------
/2017/27-07-17/number-letter-counts-room2/README.md:
--------------------------------------------------------------------------------
1 | # Number Letter Counts
2 |
3 | ## Problem Description
4 |
5 |
6 |
7 | If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
8 |
9 | Stage 1 - requirements
10 | ```
11 | If all the numbers from 1 to 50 (fifty) inclusive were written out in words, how many letters would be used?
12 | ```
13 |
14 | Stage 2 - requirements
15 | ```
16 | If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
17 | ```
18 |
19 | NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
20 |
21 |
22 | From: https://projecteuler.net/
23 |
--------------------------------------------------------------------------------
/2017/27-07-17/number-letter-counts-room2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "number-letter-counts",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/29-06-17/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Fizz Buzz and Tennis Refactoring Kata
3 | * **Where:** [Arbor Networks](https://www.arbornetworks.com/)
4 | * **When:** 29/06/2017
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2017/29-06-17/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/29-06-17/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2017/29-06-17/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | function divisibleBy(number, divisor) {
3 | return number % divisor == 0;
4 | }
5 | function FizzBuzz(number)
6 | {
7 | if (divisibleBy(number, 3)) {
8 | return 'Fizz';
9 | }else if (number%5==0) {
10 | return 'Buzz';
11 | }
12 |
13 | return number;
14 |
15 | }
16 |
17 | describe('Fizz Buzz Game', function() {
18 |
19 |
20 | it('returns numbers as the same', () => {
21 |
22 | assert.equal(FizzBuzz(1), 1);
23 | assert.equal(FizzBuzz(4), 4);
24 |
25 | });
26 |
27 | it('Returns Fizz When number is divisible by 3', () => {
28 |
29 | assert.equal(FizzBuzz(3), 'Fizz');
30 | assert.equal(FizzBuzz(6), 'Fizz');
31 | });
32 |
33 | it('Returns Buzz when the number is divisible by 5', () => {
34 |
35 |
36 | assert.equal(FizzBuzz(5), 'Buzz');
37 | assert.equal(FizzBuzz(10), 'Buzz');
38 | });
39 |
40 | });
41 |
--------------------------------------------------------------------------------
/2017/29-06-17/tennis-refactoring-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2017/29-06-17/tennis-refactoring-kata/TennisTest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tennis Test
4 |
5 |
6 | Tests incomplete
7 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/2018/05-04-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Berlin Clock Kata
3 | * **Where:** Arbor Networks
4 | * **When:** 05/04/2018
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2018/05-04-2018/berlin-clock-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "berlin-clock-kata",
3 | "version": "1.0.0",
4 | "description": "## Problem Description",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "mocha": "^5.0.5"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/08-03-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Berlin Clock Kata, Fizz Buzz Kata and Roman Numerals
3 | * **Where:** Arbor Networks
4 | * **When:** 08/03/2018
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2018/08-03-2018/berlin-clock-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "berlin-clock-kata",
3 | "version": "1.0.0",
4 | "description": "Berlin Kata Clock",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "mocha": "^5.0.4"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/08-03-2018/berlin-clock-kata/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | const calculateSeconds = (seconds) => {
4 | return parseInt(seconds) % 2 == 0 ? 'Y' : 'O';
5 | };
6 |
7 | const calculateMinutes = (minutes) => {
8 | if (minutes === '1') {
9 | return 'YOOO'
10 | }
11 | return 'YYOO';
12 | };
13 |
14 | describe('Berlin Clock Kata', () => {
15 |
16 | it('even seconds should be yellow light', () => {
17 | let actual = calculateSeconds('00');
18 | const expect = 'Y';
19 | assert.equal(actual, expect);
20 |
21 | actual = calculateSeconds('30');
22 | assert.equal(actual, expect);
23 | });
24 |
25 | it('odd seconds should be off', () => {
26 | let actual = calculateSeconds('01');
27 | const expect = 'O';
28 | assert.equal(actual, expect);
29 |
30 | actual = calculateSeconds('23');
31 | assert.equal(actual, expect);
32 | });
33 |
34 | it('calculate minutes', () => {
35 | let actual = calculateMinutes('1');
36 | const expect = 'YOOO';
37 | assert.equal(actual, expect);
38 | });
39 | it('calculate minutes', () => {
40 | let actual = calculateMinutes('2');
41 | const expect = 'YYOO';
42 | assert.equal(actual, expect);
43 | });
44 | })
45 |
--------------------------------------------------------------------------------
/2018/08-03-2018/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/08-03-2018/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "jest --watch"
5 | },
6 | "devDependencies": {
7 | "jest": "^22.4.2"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/08-03-2018/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | describe('Fizz Buzz Game', function() {
2 | it('takes regular number and returns the same number', () => {
3 | expect(fizzBuzz(1)).toEqual(1);
4 | expect(fizzBuzz(2)).toEqual(2);
5 | });
6 | it('takes multiple of 3 and return Fizz', () => {
7 | expect(fizzBuzz(3)).toEqual('Fizz');
8 | expect(fizzBuzz(6)).toEqual('Fizz');
9 | expect(fizzBuzz(21)).toEqual('Fizz');
10 | });
11 | it('takes multiple of 5 and return Buzz', () => {
12 | expect(fizzBuzz(10)).toEqual('Buzz');
13 | expect(fizzBuzz(5)).toEqual('Buzz');
14 | });
15 | it('takes multiple of both 3 and 5 and returns FizzBuzz', () => {
16 | expect(fizzBuzz(60)).toEqual('FizzBuzz');
17 | expect(fizzBuzz(15)).toEqual('FizzBuzz');
18 | expect(fizzBuzz(30)).toEqual('FizzBuzz');
19 | });
20 | });
21 |
22 | function fizzBuzz(input) {
23 | let fbString = '';
24 |
25 | if(input % 3 === 0)
26 | fbString = 'Fizz'
27 |
28 | if(input % 5 === 0)
29 | fbString += 'Buzz'
30 |
31 | return fbString || input;
32 | }
33 |
--------------------------------------------------------------------------------
/2018/08-03-2018/roman-numerals/.nvmrc:
--------------------------------------------------------------------------------
1 | v9.2.0
2 |
--------------------------------------------------------------------------------
/2018/08-03-2018/roman-numerals/README.md:
--------------------------------------------------------------------------------
1 | ## Roman Numerals
2 |
3 | ## Problem Description
4 |
5 | The Romans were a clever bunch. They conquered most of Europe and ruled it for
6 | hundreds of years. They invented concrete and straight roads and even bikinis.
7 | One thing they never discovered though was the number zero. This made writing
8 | and dating extensive histories of their exploits slightly more challenging, but
9 | the system of numbers they came up with is still in use today. For example the
10 | BBC uses Roman numerals to date their programmes.
11 |
12 | The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice these
13 | letters have lots of straight lines and are hence easy to hack into stone
14 | tablets).
15 |
16 | The Kata says you should write a function to convert from normal numbers to
17 | Roman Numerals. E.g.:
18 |
19 | 1 -> I
20 | 10 -> X
21 | 7 -> VII
22 |
23 | For a full description of how it works, take a look at
24 | https://en.wikipedia.org/wiki/Roman_numerals
25 |
26 | There is no need to be able to convert numbers larger than about 3000 (the
27 | Romans themselves didn't tend to go any higher). Note that you can't write
28 | numerals like "IM" for 999. Wikipedia says: Modern Roman numerals (…) are
29 | written by expressing each digit separately starting with the left most digit
30 | and skipping any digit with a value of zero. To see this in practice, consider
31 | the (…) example of 1990. In Roman numerals 1990 is rendered: 1000=M, 900=CM,
32 | 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII.
33 |
34 | Here are a few more examples you can use as test cases:
35 |
36 | 1954 -> MCMLIV
37 | 1990 -> MCMXC
38 | 2014 -> MMXIV
39 |
40 | # Extension:
41 |
42 | Write a function to convert in the other direction, i.e. numeral to digit.
43 |
--------------------------------------------------------------------------------
/2018/08-03-2018/roman-numerals/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "roman-numerals",
3 | "scripts": {
4 | "test": "jest --watchAll"
5 | },
6 | "devDependencies": {
7 | "jest": "^22.4.2"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/08-03-2018/roman-numerals/test.js:
--------------------------------------------------------------------------------
1 | function converter(number) {
2 | let result = '';
3 | let roman = 'I';
4 | if (number <= 3) {
5 | for (cnt = 0; cnt < number; cnt++) {
6 | result = result + roman;
7 | }
8 | } else if (number === 4){
9 | result = "IV";
10 | } else if (number === 5){
11 | result = "V";
12 | } else if (number <= 6 || number <=8) {
13 | result = "V";
14 | for (cnt = 5; cnt < number; cnt++) {
15 | result = result + roman;
16 | }
17 | }
18 | return result;
19 | }
20 |
21 | describe("Roman Numerals", () => {
22 | it("returns I when number is 1", () => {
23 | expect(converter(1)).toEqual("I");
24 | });
25 |
26 | it("returns III when number is 3", () => {
27 | expect(converter(3)).toEqual("III");
28 | });
29 |
30 | it("returns V when number is 5", () => {
31 | expect(converter(5)).toEqual("V");
32 | });
33 |
34 | it("returns II when number is 2", () => {
35 | expect(converter(2)).toEqual("II");
36 | });
37 |
38 | it("returns IV when number is 4", () => {
39 | expect(converter(4)).toEqual("IV");
40 | });
41 |
42 | it("returns VII when number is 7", () => {
43 | expect(converter(7)).toEqual("VII");
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/2018/10-05-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Berlin Clock and Fizz Buzz Kata
3 | * **Where:** Arbor Networks
4 | * **When:** 10/05/2018
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2018/10-05-2018/berlin-clock-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "berlin-clock-kata",
3 | "version": "1.0.0",
4 | "description": "## Problem Description",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "mocha": "^5.0.5"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/10-05-2018/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/10-05-2018/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/10-05-2018/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | const printFizzBuzzGame =(num) => {
4 | if (num % 3 ==0 && num % 5 == 0) return 'FizzBuzz';
5 | if (num % 3 == 0) return 'Fizz';
6 | else if (num % 5 == 0) return 'Buzz';
7 | return num;
8 | }
9 |
10 | describe('Fizz Buzz Game', function() {
11 |
12 | it('printing the number num for num', () => {
13 |
14 | assert.equal(printFizzBuzzGame(1), 1);
15 | assert.equal(printFizzBuzzGame(2), 2);
16 | });
17 |
18 |
19 | it('printing Fizz for number divided by 3', () => {
20 |
21 | assert.equal(printFizzBuzzGame(3), 'Fizz');
22 | assert.equal(printFizzBuzzGame(6), 'Fizz');
23 | assert.equal(printFizzBuzzGame(9), 'Fizz');
24 | });
25 |
26 | it('printing Buzz for numbers divided by 5', () => {
27 |
28 | assert.equal(printFizzBuzzGame(5), 'Buzz');
29 | assert.equal(printFizzBuzzGame(10), 'Buzz');
30 |
31 | });
32 |
33 | it('printing FizzBuzz for numbers divided by 3 and 5', () => {
34 | assert.equal(printFizzBuzzGame(15), 'FizzBuzz');
35 | assert.equal(printFizzBuzzGame(30), 'FizzBuzz');
36 | assert.equal(printFizzBuzzGame(45), 'FizzBuzz');
37 |
38 | });
39 |
40 | });
41 |
--------------------------------------------------------------------------------
/2018/11-10-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Scrabble, api-node-imdb, api-node-imdb2
3 | * **Where:** Arbor Networks
4 | * **When:** 10/11/2018
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2018/11-10-2018/api-desing-node/api.test.js:
--------------------------------------------------------------------------------
1 | // {
2 | // movie: {
3 | // // id,
4 | // title
5 | // description
6 | // },
7 | // status: 'successfully added movie'
8 |
9 | // }
10 |
11 |
12 | function createMovie(title, description){
13 | if(description == ''){
14 | return 'Movie should have a description';
15 | }else if (title == '' ){
16 | return 'Movie should have a title';
17 | } else {
18 | return {
19 | movie: {
20 | title: title,
21 | description: description
22 | },
23 | status: 'successfully added movie'
24 | }
25 | }
26 |
27 | }
28 |
29 | describe('Creating a movie', () => {
30 | it('Movie without title should return error', () => {
31 | const movie = {
32 | title: '',
33 | description: 'hello'
34 | };
35 | expect(createMovie(movie.title, movie.description)).toBe('Movie should have a title');
36 | })
37 | it('Movie without description should return error', () => {
38 | const movie = {
39 | title: 'Harry Potter',
40 | description: ''
41 | };
42 | expect(createMovie(movie.title, movie.description)).toBe('Movie should have a description');
43 | })
44 | it('createMovie should return object',() => {
45 | const movie = {
46 | title: 'Game of Thrones',
47 | description: 'White Walkers'
48 | };
49 | const expectedMovie = {
50 | movie: {
51 | title: 'Game of Thrones',
52 | description: 'White Walkers'
53 | },
54 | status: 'successfully added movie'
55 | }
56 | expect(createMovie(movie.title, movie.description)).toEqual(expectedMovie);
57 | })
58 |
59 | });
60 |
--------------------------------------------------------------------------------
/2018/11-10-2018/api-desing-node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api-desing-node",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "jest --watch"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "jest": "^23.6.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/11-10-2018/api-node-imbd/core/create-movie.js:
--------------------------------------------------------------------------------
1 | const isDuplicated = (movieCollection, movieName) =>
2 | movieCollection.some(movie => movie.title === movieName);
3 |
4 | const createMovie = database => (title, description) => {
5 | if (!title && !description) {
6 | return "Movie title and description was required";
7 | } else if (!title) {
8 | return "Movie title was required";
9 | } else if (!description) {
10 | return "Movie description was required";
11 | }
12 |
13 | const allMovies = database.getAll();
14 |
15 | if (isDuplicated(allMovies, title)) {
16 | return "Movie name is duplicate.";
17 | }
18 |
19 | return database.saveMovie(title, description);
20 | };
21 |
22 | module.exports = createMovie;
23 |
--------------------------------------------------------------------------------
/2018/11-10-2018/api-node-imbd/database/index.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 | mongoose.connect('mongodb://localhost/test');
3 |
--------------------------------------------------------------------------------
/2018/11-10-2018/api-node-imbd/database/index.spec.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 | mongoose.connect('mongodb://localhost/movieDatabase');
3 |
4 | var movieDatabaseSchema = mongoose.model('Movie', new mongoose.Schema({
5 | title: String,
6 | description: String
7 | }));
8 |
9 | const database = {
10 | saveMovie: async (title, description) => {
11 | await movieDatabaseSchema.create({title,description})
12 | },
13 | getAll: async () => {
14 | return await movieDatabaseSchema.find() }
15 | };
16 |
17 | describe('Database', () => {
18 | it('Saves a movie', async () => {
19 | const movie = {
20 | title: 'Despicable Me',
21 | description: 'A movie'
22 | };
23 |
24 | await database.saveMovie(movie.title, movie.description);
25 |
26 | const allMovies = await database.getAll();
27 |
28 | expect(allMovies[0].title).toBe(movie.title);
29 | expect(allMovies[0].description).toBe(movie.description);
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/2018/11-10-2018/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api-node-imbd",
3 | "version": "1.0.0",
4 | "description": "a kata to learn about building an Node API from scratch",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "jest --watch"
8 | },
9 | "author": "Coding Dojo Team",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "jest": "^23.6.0"
13 | },
14 | "dependencies": {
15 | "mongoose": "^5.3.2"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/2018/13-09-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** FizzBuzz/Scrabble , api-node-imdb
3 | * **Where:** Arbor Networks
4 | * **When:** 13/08/2018
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2018/13-09-2018/api-node-imbd/README.md:
--------------------------------------------------------------------------------
1 | This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach
2 |
3 | ## Requirements
4 | - good understanding of JavaScript
5 | - basic knowledge of server/client request/response
6 | - basic understanding of HTTP
7 | - basic understanding of GIT
8 |
9 | ## Development using
10 | - Node.js
11 | - MongoDB
12 | - TDD approach
13 | - [Postman](https://www.getpostman.com/) - API development environment
14 | - [Robo 3T](https://robomongo.org/) - a free lightweight GUI for MongoDB enthusiasts
15 |
16 |
17 | ## User Story 1
18 | 1. As a User I want to insert movie information to create my own movie database.
19 |
20 | ### Acceptance Criteria
21 | - The movie to be inserted must have title and description
22 | - User cannot enter the same movie name again i.e duplicates must be tracked based on the title of the movie
23 | - The user must send the data to the API in JSON format
24 |
25 | ## User Story 2
26 | Coming soon...
27 |
--------------------------------------------------------------------------------
/2018/13-09-2018/api-node-imbd/core/create-movie.js:
--------------------------------------------------------------------------------
1 | const createMovie = (title, description) => {
2 | if (title === "") {
3 | return "Movie title was required"
4 | }
5 | else {
6 | return "Movie description was required"
7 | }
8 | }
9 |
10 | module.exports=createMovie;
11 |
--------------------------------------------------------------------------------
/2018/13-09-2018/api-node-imbd/core/create-movie.spec.js:
--------------------------------------------------------------------------------
1 | const createMovie = require("./create-movie");
2 |
3 |
4 | describe('Create movie', () => {
5 | it('Requires movie with a title', () => {
6 | const title = "";
7 | const description = "some description here";
8 | expect(createMovie(title, description)).toBe('Movie title was required');
9 | });
10 |
11 | it('Requires movie with a description', () => {
12 | const title = "Star Wars";
13 | const description = "";
14 | expect(createMovie(title, description)).toBe('Movie description was required');
15 | });
16 |
17 |
18 | });
19 |
20 |
--------------------------------------------------------------------------------
/2018/13-09-2018/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api-node-imbd",
3 | "version": "1.0.0",
4 | "description": "a kata to learn about building an Node API from scratch",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "jest --watch"
8 | },
9 | "author": "Coding Dojo Team",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "jest": "^23.6.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/13-09-2018/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/13-09-2018/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "jest",
5 | "test:watch": "jest --watch"
6 | },
7 | "devDependencies": {
8 | "jest": "^23.6.0"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/2018/13-09-2018/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Fizz Buzz Game', function() {
4 |
5 | it('should print fizz if a number is a multiple of 3', () => {
6 |
7 | const result = fizzbuzz(3);
8 |
9 | assert.equal(result, "fizz");
10 | });
11 |
12 | it('should print buzz if a number is a multiple of 5', () => {
13 |
14 | const result = fizzbuzz(5);
15 |
16 | assert.equal(result, "buzz");
17 | });
18 |
19 | it('should print fizzbuzz if a number is a multiple of 5 and 3', () => {
20 |
21 | const result = fizzbuzz(15);
22 |
23 | assert.equal(result, "fizzbuzz");
24 | });
25 | it('should print the number as a string if not divisible by neither 5 nor 3', () => {
26 |
27 |
28 | const result = fizzbuzz(1);
29 |
30 | assert.equal(result, "1");
31 | });
32 |
33 | });
34 |
35 | const fizzbuzz = function(number){
36 |
37 | if(number%15==0){
38 | return "fizzbuzz";
39 | }
40 |
41 | if(number%3==0){
42 | return "fizz";
43 | }
44 | if(number%5==0){
45 | return "buzz";
46 | }
47 | return number;
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/2018/13-09-2018/scrabble-score/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/13-09-2018/scrabble-score/README.md:
--------------------------------------------------------------------------------
1 | # Scrabble Score
2 | Given a word, compute the scrabble score for that word.
3 |
4 | ## Letter Values
5 | You'll need these:
6 | ```
7 | Letter Value
8 | A, E, I, O, U, L, N, R, S, T 1
9 | D, G 2
10 | B, C, M, P 3
11 | F, H, V, W, Y 4
12 | K 5
13 | J, X 8
14 | Q, Z 10
15 | ```
16 | E.g. Javascript should return `24`:
17 | * 8 points for `j`,
18 | * 1 point for `a` twice,
19 | * 4 points for `v`,
20 | * 1 point for `s`,
21 | * 3 points for `c`,
22 | * 1 point for `r`,
23 | * 1 point for `i`,
24 | * 3 points for `p`,
25 | * 1 point for `t`
26 |
27 | Which gives us a total of `24`.
28 |
29 | Inspired from [rchantley's extreme startup game](https://github.com/rchatley/extreme_startup).
30 |
--------------------------------------------------------------------------------
/2018/13-09-2018/scrabble-score/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scrabble-scoring-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/13-09-2018/scrabble-score/test.js:
--------------------------------------------------------------------------------
1 | /* Letter value table
2 | Letter Value
3 | A, E, I, O, U, L, N, R, S, T 1
4 | D, G 2
5 | B, C, M, P 3
6 | F, H, V, W, Y 4
7 | K 5
8 | J, X 8
9 | Q, Z 10
10 | */
11 |
12 | const assert = require('assert');
13 |
14 |
15 | function scrabbleScore(word) {
16 | //your solution
17 | return 0;
18 | }
19 |
20 |
21 | describe('Scrabble scoring game', () => {
22 |
23 | it('scores an empty word as zero', () => {
24 | const expected = 0;
25 | const actual = scrabbleScore('');
26 | assert.equal(actual, expected);
27 | });
28 |
29 | });
30 |
--------------------------------------------------------------------------------
/2018/19-04-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Berlin Clock Kata and Fizz Buzz Kata
3 | * **Where:** Quantium
4 | * **When:** 19/04/2018
5 |
6 |
--------------------------------------------------------------------------------
/2018/19-04-2018/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/19-04-2018/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/22-03-18/berlin-clock-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "berlin-clock-kata",
3 | "version": "1.0.0",
4 | "description": "## Problem Description",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "mocha": "^5.0.4"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/22-03-18/berlin-clock-kata/test.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 |
3 | function displaySeconds(seconds) {
4 | return seconds % 2 === 0 ? 'Y' : 'O';
5 | }
6 |
7 | function displayMinutes(minutes) {
8 | if (minutes === 1) {
9 | return 'YOOO';
10 | }
11 |
12 | return 'YYOO'
13 | }
14 |
15 | describe('Berlin Clock', function() {
16 |
17 | it('should return Y for even seconds', function() {
18 |
19 | var light = displaySeconds(0);
20 |
21 | assert.equal(light, 'Y');
22 |
23 |
24 | light = displaySeconds(2);
25 |
26 | assert.equal(light, 'Y');
27 |
28 | });
29 | it('should return O for odd seconds', function() {
30 |
31 | var light = displaySeconds(1);
32 |
33 | assert.equal(light, 'O');
34 |
35 |
36 | light = displaySeconds(3);
37 |
38 | assert.equal(light, 'O');
39 |
40 | });
41 | it('should return YOOO for one minute', function() {
42 |
43 | var light = displayMinutes(1);
44 |
45 | assert.equal(light, 'YOOO');
46 |
47 | });
48 |
49 | it('should return YYOO for two minutes', function() {
50 |
51 | var light = displayMinutes(2);
52 |
53 | assert.equal(light, 'YYOO');
54 |
55 | });
56 |
57 | });
--------------------------------------------------------------------------------
/2018/22-03-2018/README.md:
--------------------------------------------------------------------------------
1 | * **Format:** Mob Programming
2 | * **Katas:** Berlin Clock Kata, Fizz Buzz Kata and Ceaser Cipher katas
3 | * **Where:** Quantium
4 | * **When:** 22/03/2018
5 |
6 |
7 |
--------------------------------------------------------------------------------
/2018/22-03-2018/ceasar-shift-cipher/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/22-03-2018/ceasar-shift-cipher/README.md:
--------------------------------------------------------------------------------
1 | # Ceaser Shift Cipher
2 |
3 | ## Problem Description
4 |
5 | Cryptography is one of most interesting branches of programming. Studying its algorithms usually begins with the simple method named after famous Roman emperor Julius Caesar who used it for communicating his military secrets (and perhaps for love letters to Cleopatra).
6 |
7 | Let us Deciphere encrypted Messages
8 |
9 | The idea of the algorithm is simple. Each letter of the original text is substituted by another, by the following rule:
10 |
11 | find the letter (which should be encrypted) in the alphabet;
12 | move ```K ``` positions further (down the alphabet), where K is the Shift value
13 | take the new letter from here;
14 | if "shifting" encountered the end of the algorithm, continue from its start.
15 |
16 | For example, if K = 3 (shift value used by Caesar himself), then A becomes D, B becomes E, W becomes Z and Z becomes C and so on, according to the following table:
17 |
18 | so when K is 3,
19 | YHQL YLGL YLFL should return VENI VIDI VICI.
20 |
21 |
22 | Note:
23 | The value of K can either be pre-determined or got as an input from the user
24 |
25 | From: http://www.codeabbey.com/
26 |
--------------------------------------------------------------------------------
/2018/22-03-2018/ceasar-shift-cipher/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ceaserShiftCipher",
3 | "version": "1.01",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/2018/22-03-2018/ceasar-shift-cipher/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ceaser-shift-cipher",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "test": "mocha -w"
6 | },
7 | "devDependencies": {
8 | "mocha": "3.2.0"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/2018/22-03-2018/ceasar-shift-cipher/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | const ceaser = (str) => {
4 |
5 | let newStr = "";
6 | for (let i = 0; i < str.length;i++) {
7 | let code = str.charCodeAt(i);
8 | if(code>=65&&code<=67){
9 | code-=23;
10 | }
11 | code-=3;
12 | newStr += String.fromCharCode(code);
13 | }
14 | return newStr;
15 | }
16 |
17 |
18 | describe('Ceaser Shift Cipher', () => {
19 |
20 | it('should return V given Y, when K = 3', () => {
21 | const expected = "V";
22 | const actual = ceaser("Y");
23 |
24 | assert.equal(actual, expected);
25 | });
26 |
27 | it('should return W given Z, when K = 3', () => {
28 | const expected = "W";
29 | const actual = ceaser("Z");
30 |
31 | assert.equal(actual, expected);
32 | });
33 |
34 | it('should return AA given DD, when K = 3', () => {
35 | const expected = "AA";
36 | const actual = ceaser("DD");
37 |
38 | assert.equal(actual, expected);
39 | });
40 |
41 | it('should return BB given EE, when K = 3', () => {
42 | const expected = "BB";
43 | const actual = ceaser("EE");
44 |
45 | assert.equal(actual, expected);
46 | });
47 |
48 | it('should return ZZ given CC, when K = 3', () => {
49 | const expected = "ZZ";
50 | const actual = ceaser("CC");
51 |
52 | assert.equal(actual, expected);
53 | });
54 |
55 | });
--------------------------------------------------------------------------------
/2018/22-03-2018/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/22-03-2018/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "test": "mocha -w"
6 | },
7 | "devDependencies": {
8 | "mocha": "3.2.0"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/2018/22-03-2018/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | function fizzBuzz(y) {
4 | if ((y % 3 === 0) && (y % 5 ===0)) {
5 | return 'FizzBuzz';
6 | } else if (y % 3 === 0) {
7 | return 'Fizz';
8 | } else if (y % 5 === 0) {
9 | return 'Buzz';
10 | } else {
11 | return y;
12 | }
13 |
14 | /*
15 | The case is used to hold a single value that if
16 | they are equal to the value on the switch line.
17 | if-else statements will serve you well.
18 | */
19 |
20 | // switch (true) {
21 | // case ((y % 3 === 0) && (y % 5 ===0)):
22 | // return 'FizzBuzz';
23 | // break;
24 | // case (y % 3 === 0):
25 | // return 'Fizz';
26 | // break;
27 | // case (y % 5 === 0):
28 | // return 'Buzz';
29 | // break;
30 | // default:
31 | // return y;
32 | // break;
33 | // }
34 | }
35 |
36 | describe('Fizz Buzz Game', function() {
37 |
38 | it('passing number return same number', () => {
39 | assert.equal(fizzBuzz(1), 1);
40 | assert.equal(fizzBuzz(2), 2);
41 | });
42 |
43 | it('divide by 3', () => {
44 | assert.equal(fizzBuzz(3), 'Fizz');
45 | assert.equal(fizzBuzz(6), 'Fizz');
46 | });
47 |
48 | it('divide by 5 ', () => {
49 | assert.equal(fizzBuzz(5), 'Buzz');
50 | assert.equal(fizzBuzz(10), 'Buzz');
51 | });
52 |
53 | it('divide by 3 and 5 ', () => {
54 | assert.equal(fizzBuzz(15), 'FizzBuzz');
55 | });
56 | });
57 |
--------------------------------------------------------------------------------
/2018/24-05-2018/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/24-05-2018/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/24-05-2018/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | function fizzbuzz(input) {
4 |
5 | if (input%(3*5)===0 ) {
6 | // return
7 | return 'fizzbuzz'
8 | }
9 |
10 | if (input%3===0) {
11 | return 'fizz'
12 | }
13 |
14 | if (input%5 === 0){
15 | return 'buzz'
16 | }
17 |
18 | return input
19 | }
20 |
21 | function count() {
22 | for(let i=1; i<=100; i++) {
23 | console.log(fizzbuzz(i))
24 | }
25 | }
26 |
27 | count();
28 |
29 | describe('Fizz Buzz Game', function() {
30 |
31 | it('should return 1', () => {
32 | const expected = 1;
33 | const actual = fizzbuzz(1);
34 |
35 | assert.equal(actual, expected);
36 | });
37 |
38 | it('should return 2', () => {
39 | const expected = 2;
40 | const actual = fizzbuzz(2);
41 |
42 | assert.equal(actual, expected);
43 | });
44 |
45 | it('should return fizz', () => {
46 | const expected = 'fizz';
47 | const actual = fizzbuzz(3);
48 |
49 | assert.equal(actual, expected);
50 | });
51 |
52 | it('should return buzz', () => {
53 | const expected = 'buzz';
54 | const actual = fizzbuzz(5);
55 |
56 | assert.equal(actual, expected);
57 | });
58 |
59 | it('should return fizzbuzz', () => {
60 | const expected = 'fizzbuzz';
61 | const actual = fizzbuzz(15);
62 |
63 | assert.equal(actual, expected);
64 | });
65 |
66 | it('should return fizzbuzz', () => {
67 | const expected = 'fizzbuzz';
68 | const actual = fizzbuzz(30);
69 |
70 | assert.equal(actual, expected);
71 | });
72 | });
73 |
--------------------------------------------------------------------------------
/2018/24-05-2018/roman-numerals/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2018/24-05-2018/roman-numerals/README.md:
--------------------------------------------------------------------------------
1 | # Roman Numerals
2 |
3 | ## Problem Description
4 |
5 | The Romans were a clever bunch. They conquered most of Europe and ruled it for
6 | hundreds of years. They invented concrete and straight roads and even bikinis.
7 | One thing they never discovered though was the number zero. This made writing
8 | and dating extensive histories of their exploits slightly more challenging, but
9 | the system of numbers they came up with is still in use today. For example the
10 | BBC uses Roman numerals to date their programmes.
11 |
12 | The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice these
13 | letters have lots of straight lines and are hence easy to hack into stone
14 | tablets).
15 |
16 | The Kata says you should write a function to convert from normal numbers to
17 | Roman Numerals. E.g.:
18 |
19 | 1 -> I
20 | 10 -> X
21 | 7 -> VII
22 |
23 | For a full description of how it works, take a look at
24 | https://en.wikipedia.org/wiki/Roman_numerals
25 |
26 | There is no need to be able to convert numbers larger than about 3000 (the
27 | Romans themselves didn't tend to go any higher). Note that you can't write
28 | numerals like "IM" for 999. Wikipedia says: Modern Roman numerals (…) are
29 | written by expressing each digit separately starting with the left most digit
30 | and skipping any digit with a value of zero. To see this in practice, consider
31 | the (…) example of 1990. In Roman numerals 1990 is rendered: 1000=M, 900=CM,
32 | 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII.
33 |
34 | Here are a few more examples you can use as test cases:
35 |
36 | 1954 -> MCMLIV
37 | 1990 -> MCMXC
38 | 2014 -> MMXIV
39 |
40 | # Extension:
41 |
42 | Write a function to convert in the other direction, i.e. numeral to digit.
43 |
44 | From: http://codingdojo.org/kata/RomanNumerals/
45 |
--------------------------------------------------------------------------------
/2018/24-05-2018/roman-numerals/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "roman-numerals",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/.buildkite/pipeline.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - name: ':hammer: Tests'
3 | command: 'npm run docker-test'
4 | plugins:
5 | - docker-compose#v2.1.0:
6 | run: app
7 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mhart/alpine-node:8
2 |
3 | WORKDIR /app
4 | COPY ./core/ /app/core
5 | COPY ./database/ /app/database
6 | COPY ./web/ /app/web
7 | COPY ./package.json /app/
8 | COPY ./jest.config.js /app/
9 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/app.js:
--------------------------------------------------------------------------------
1 | const app = require('./web');
2 |
3 | const port = 8081;
4 | app.listen(port, () => console.log(`Example app listening on port ${port}!`))
5 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/buildkite-agent.cfg:
--------------------------------------------------------------------------------
1 | token="BUILDAGENT_TOKEN_VALUE"
2 | build-path="$PWD"
3 | plugins-path="https://github.com/buildkite-plugins/docker-compose-buildkite-plugin"
4 |
5 | # This file is used to run the build-kite agent
6 | # Replace the token value with the token value
7 | # and then run "npm run docker-agent"
8 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/core/create-movie.js:
--------------------------------------------------------------------------------
1 | const isDuplicated = (movieCollection, movieName) =>
2 | movieCollection.some(movie => movie.title === movieName);
3 |
4 | const createMovie = database => async (title, description) => {
5 | if (!title && !description) {
6 | return "Movie title and description was required";
7 | } else if (!title) {
8 | return "Movie title was required";
9 | } else if (!description) {
10 | return "Movie description was required";
11 | }
12 |
13 | const allMovies = await database.getAll();
14 |
15 | if (isDuplicated(allMovies, title)) {
16 | return "Movie name is duplicate.";
17 | }
18 |
19 | return await database.saveMovie(title, description);
20 | };
21 |
22 | module.exports = createMovie;
23 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/database/index.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 |
3 | const db = process.env.ENV || 'PROD';
4 | const hostName = process.env.ENV === 'DOCKER' ? 'mongo' : 'localhost';
5 | const databaseUrl = `mongodb://${hostName}:27017/movieDatabase-${db}`;
6 |
7 | mongoose.connect(databaseUrl, { useNewUrlParser: true });
8 |
9 | var movieDatabaseSchema = mongoose.model('Movie', new mongoose.Schema({
10 | title: String,
11 | description: String
12 | }));
13 |
14 | const database = {
15 | saveMovie: async (title, description) => {
16 | await movieDatabaseSchema.create({title,description})
17 | },
18 | getAll: async () => {
19 | return await movieDatabaseSchema.find() }
20 | };
21 | module.exports = database;
22 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/database/index.spec.js:
--------------------------------------------------------------------------------
1 | const database = require('./index')
2 | const mongoose = require('mongoose');
3 |
4 | describe('Database', () => {
5 | beforeAll((done) => mongoose.connection.collections['movies'].drop(() => done()));
6 | afterAll((done) => mongoose.connection.close(() => done()));
7 |
8 | it('Saves a movie', async () => {
9 | const movie = {
10 | title: 'Despicable Me',
11 | description: 'A movie'
12 | };
13 |
14 | await database.saveMovie(movie.title, movie.description);
15 |
16 | const allMovies = await database.getAll();
17 |
18 | expect(allMovies[0].title).toBe(movie.title);
19 | expect(allMovies[0].description).toBe(movie.description);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 | services:
3 | app:
4 | container_name: app
5 | build: .
6 | command: npm run docker-test
7 | ports:
8 | - "3000:3000"
9 | links:
10 | - mongo
11 | mongo:
12 | container_name: mongo
13 | image: mongo
14 | ports:
15 | - "27017:27017"
16 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | testEnvironment: 'node'
3 | };
4 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api-node-imbd",
3 | "version": "1.0.0",
4 | "description": "a kata to learn about building an Node API from scratch",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "ENV=TEST jest",
8 | "test:docker": "ENV=DOCKER jest",
9 | "start": "ENV=PRODUCTION node ./app.js",
10 | "docker-test": "npm install && npm run test:docker",
11 | "docker-build": "docker build -t imdb-movies .",
12 | "docker-run" : "docker run imdb-movies npm run docker-test",
13 | "docker-agent": "docker run -v /var/run/docker.sock:/var/run/docker.sock -v \"$PWD/buildkite-agent.cfg:/buildkite/buildkite-agent.cfg:ro\" buildkite/agent"
14 | },
15 | "author": "Coding Dojo Team",
16 | "license": "ISC",
17 | "devDependencies": {
18 | "jest": "^23.6.0",
19 | "supertest": "^3.3.0"
20 | },
21 | "dependencies": {
22 | "express": "^4.16.4",
23 | "mongoose": "^5.3.2"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/web/index.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const db = require('../database');
3 | const core = require('../core/create-movie.js');
4 | var bodyParser = require('body-parser');
5 | const app = express();
6 |
7 | app.use(bodyParser.json());
8 |
9 | app.post('/movie', async function(req, res) {
10 | const error = await core(db)(req.body.title, req.body.description);
11 |
12 | if (error) {
13 | return res.status(400).send(error);
14 | }
15 |
16 | res.status(201).json({ title: req.body.title, description: req.body.description });
17 | });
18 |
19 | module.exports = app;
20 |
--------------------------------------------------------------------------------
/2018/25-10-2018/api-node-imbd/web/index.spec.js:
--------------------------------------------------------------------------------
1 | const request = require('supertest');
2 | const app = require('./index');
3 | const mongoose = require('mongoose');
4 |
5 | describe('web', () => {
6 | beforeAll((done) => mongoose.connection.collections['movies'].drop(() => done()));
7 | afterAll((done) => mongoose.connection.close(() => done()));
8 |
9 | it('Saves a valid movie', async () => {
10 | const response = await request(app)
11 | .post('/movie')
12 | .send({title: 'Despicable Me 3', description: 'Another movie'})
13 | .set('Accept', 'application/json')
14 |
15 | expect(response.status).toBe(201)
16 | expect(response.body.title).toBe("Despicable Me 3");
17 | expect(response.body.description).toBe("Another movie");
18 | });
19 |
20 | it('Does not save an invalid movie', async () => {
21 | const response = await request(app)
22 | .post('/movie')
23 | .send()
24 | .set('Accept', 'application/json')
25 |
26 | expect(response.status).toBe(400);
27 | expect(response.text).toBeDefined();
28 | })
29 | });
30 |
--------------------------------------------------------------------------------
/2018/25-10-2018/banking-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 8
2 |
--------------------------------------------------------------------------------
/2018/25-10-2018/banking-kata/Account.js:
--------------------------------------------------------------------------------
1 | class Account {
2 | deposit(val){
3 | if (val === undefined) throw new Error('input val undefined');
4 | if (typeof val !== "number") throw new Error('input val requires to be a number');
5 |
6 | };
7 | withdraw(val){
8 | if(val === undefined) throw new Error('Input val undefined');
9 |
10 | }
11 | }
12 |
13 | module.exports = Account;
--------------------------------------------------------------------------------
/2018/25-10-2018/banking-kata/README.md:
--------------------------------------------------------------------------------
1 | # Banking Kata
2 |
3 | ## Problem Description
4 |
5 | Your bank is tired of its mainframe COBOL accounting software and they hired both of you for a greenfield project in - what a happy coincidence: your favorite programming language!
6 |
7 | Your task is to show them that your TDD-fu and your new-age programming language can cope with good ole’ COBOL!
8 |
9 | #### Requirements
10 |
11 | Write a class `Account` that offers the following methods:
12 |
13 | ```
14 | void deposit(int)
15 | void withdraw(int)
16 | String printStatement()
17 | ```
18 |
19 | An example statement would be:
20 |
21 | ```
22 | Date Amount Balance
23 | 24.12.2015 +500 500
24 | 23.8.2016 -100 400
25 | ```
26 |
27 | From: http://kata-log.rocks/banking-kata
28 |
--------------------------------------------------------------------------------
/2018/25-10-2018/banking-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "banking-kata",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/25-10-2018/bowling-game/README.md:
--------------------------------------------------------------------------------
1 | # Bowling Game
2 |
3 | ## Problem Description
4 |
5 | [bowling-score]: http://www.wpclipart.com/recreation/sports/bowling/bowling_scoresheet_example.png "bowling score card"
6 |
7 | ![Bowling scoreboard][bowling-score]
8 |
9 | The game consists of 10 frames as shown above. In each frame the player has
10 | two opportunities to knock down 10 pins. The score for the frame is the total
11 | number of pins knocked down, plus bonuses for strikes and spares.
12 |
13 | A spare is when the player knocks down all 10 pins in two tries. The bonus for
14 | that frame is the number of pins knocked down by the next roll. So in frame 3
15 | above, the score is 10 (the total number knocked down) plus a bonus of 5 (the
16 | number of pins knocked down on the next roll.)
17 |
18 | A strike is when the player knocks down all 10 pins on his first try. The bonus
19 | for that frame is the value of the next two balls rolled.
20 |
21 | In the tenth frame a player who rolls a spare or strike is allowed to roll the extra
22 | balls to complete the frame. However no more than three balls can be rolled in
23 | tenth frame.
24 |
25 |
26 | ## The requirements
27 |
28 | * Write class "BowlingGame" that has two methods
29 | - *roll(pins)*
30 | - called each time the player rolls a ball. The argument is the number of pins knocked down.
31 | - *score()*
32 | - called only after the very end of the game. Returns total score of the game.
33 |
34 | From: https://github.com/hontas/bowling-game-kata
35 |
--------------------------------------------------------------------------------
/2018/25-10-2018/bowling-game/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bowling-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2018/25-10-2018/bowling-game/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Bowling Game', function() {
4 | it('gets 1 if 1 pin down', () => {
5 | const game = new BowlingGame();
6 | const expected = 1;
7 | game.roll(1);
8 | const actual = game.score();
9 |
10 | assert.equal(actual, expected);
11 | });
12 | it('gets 2 if 2 pins down', () => {
13 | const game = new BowlingGame();
14 | const expected = 2;
15 | game.roll(2);
16 | const actual = game.score();
17 |
18 | assert.equal(actual, expected);
19 | });
20 | it('gets 2 after 2 rolls with 1 pin down in each', () => {
21 | const expected = 2;
22 |
23 | const game = new BowlingGame();
24 | game.roll(1);
25 | game.roll(1);
26 | const actual = game.score();
27 |
28 | assert.equal(actual, expected);
29 | });
30 | it('gets 12 after 3 rolls with 5, 5 and 1', () => {
31 | const expected = 12;
32 |
33 | const game = new BowlingGame();
34 | game.roll(5);
35 | game.roll(5);
36 | game.roll(1);
37 | const actual = game.score();
38 |
39 | assert.equal(actual, expected);
40 | });
41 | });
42 |
43 | class BowlingGame {
44 | constructor() {
45 | this.pins = 0;
46 | }
47 | roll(pinsN) {
48 | // return pinsN;
49 | this.pins += pinsN;
50 | }
51 |
52 | score() {
53 | return this.pins;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/2018/27-09-2018/api-node-imbd/README.md:
--------------------------------------------------------------------------------
1 | This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach
2 |
3 | ## Requirements
4 | - good understanding of JavaScript
5 | - basic knowledge of server/client request/response
6 | - basic understanding of HTTP
7 | - basic understanding of GIT
8 |
9 | ## Development using
10 | - Node.js
11 | - TDD approach
12 | - [Postman](https://www.getpostman.com/) - API development environment
13 | - [Robo 3T](https://robomongo.org/) - a free lightweight GUI for MongoDB enthusiasts
14 |
15 |
16 | ## User Story 1
17 | 1. As a User I want to insert movie information to create my own movie database.
18 |
19 | ### Acceptance Criteria
20 | - The movie to be inserted must have title and description
21 | - User cannot enter the same movie name again i.e duplicates must be tracked based on the title of the movie
22 | - The user must send the data to the API in JSON format
23 |
24 | ## User Story 2
25 | Coming soon...
26 |
--------------------------------------------------------------------------------
/2018/27-09-2018/api-node-imbd/core/create-movie.js:
--------------------------------------------------------------------------------
1 | const isDuplicated = (movieCollection, movieName) =>
2 | movieCollection.some(movie => movie.title === movieName);
3 |
4 | const createMovie = database => (title, description) => {
5 | if (title === "" && description === "") {
6 | return "Movie title and description was required";
7 | } else if (title === "") {
8 | return "Movie title was required";
9 | } else if (description === "") {
10 | return "Movie description was required";
11 | }
12 |
13 | const allMovies = database.getAll();
14 |
15 | if (isDuplicated(allMovies, title)) {
16 | return "Movie name is duplicate.";
17 | }
18 |
19 | return JSON.stringify(database.saveData());
20 | };
21 |
22 | module.exports = createMovie;
23 |
--------------------------------------------------------------------------------
/2018/27-09-2018/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api-node-imbd",
3 | "version": "1.0.0",
4 | "description": "a kata to learn about building an Node API from scratch",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "jest --watch"
8 | },
9 | "author": "Coding Dojo Team",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "jest": "^23.6.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2018/27-09-2018/api-node-imdb-2/README.md:
--------------------------------------------------------------------------------
1 | This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach
2 |
3 | ## Requirements
4 | - good understanding of JavaScript
5 | - basic knowledge of server/client request/response
6 | - basic understanding of HTTP
7 | - basic understanding of GIT
8 |
9 | ## Development using
10 | - Node.js
11 | - MongoDB
12 | - TDD approach
13 | - [Postman](https://www.getpostman.com/) - API development environment
14 | - [Robo 3T](https://robomongo.org/) - a free lightweight GUI for MongoDB enthusiasts
15 |
16 |
17 | ## User Story 1
18 | 1. As a User I want to insert movie information to create my own movie database.
19 |
20 | ### Acceptance Criteria
21 | - The movie to be inserted must have title and description
22 | - User cannot enter the same movie name again i.e duplicates must be tracked based on the title of the movie
23 | - The user must send the data to the API in JSON format
24 |
25 | ## User Story 2
26 | Coming soon...
27 |
--------------------------------------------------------------------------------
/2018/27-09-2018/api-node-imdb-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api-node-imbd",
3 | "version": "1.0.0",
4 | "description": "Database for movies",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {},
12 | "devDependencies": {
13 | "chai": "^4.2.0",
14 | "mocha": "^5.2.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/2018/27-09-2018/api-node-imdb-2/test.js:
--------------------------------------------------------------------------------
1 | const expect = require('chai').expect;
2 |
3 | const createMovie = (movie) => {
4 |
5 | if(!movie.title || movie.title === ''){
6 | return 'The movie title is required.';
7 | }
8 | if(!movie.description || movie.description === ''){
9 | return 'The movie description is required.';
10 | }
11 | return '';
12 | }
13 |
14 | const isEmpty = (field) => {
15 |
16 | return field==="";
17 | }
18 |
19 | describe('Creating a movie', () => {
20 | it('should return an empty title error', () => {
21 | const movie = {
22 | title : '',
23 | description: 'Some description...'
24 | }
25 | expect(createMovie(movie)).to.equal('The movie title is required.');
26 | });
27 |
28 | it('should return an empty description error', () => {
29 | const movie = {
30 | title : 'Movie title',
31 | description: ''
32 | }
33 | expect(createMovie(movie)).to.equal('The movie description is required.');
34 | });
35 | });
36 | describe('testin if fields are empty', () => {
37 | it('should return true if field is empty', () => {
38 | const field = "";
39 | expect(isEmpty(field)).to.equal(true);
40 | });
41 | });
42 |
--------------------------------------------------------------------------------
/2019/14-Mar-2019/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/2019/14-Mar-2019/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "jest"
5 | },
6 | "devDependencies": {
7 | "jest": "^24.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2019/14-Mar-2019/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const list_numbers = (number) => {
2 | var listNum = [];
3 | for( i=1; i<=number; i++) {
4 |
5 | listNum.push(i);
6 | }
7 | return listNum;
8 | }
9 |
10 | describe('fizz Buzz game ', function() {
11 |
12 | it('expect a number ', () => {
13 | const expected = [1];
14 | const actual = list_numbers(1);
15 |
16 |
17 |
18 | expect(expected).toEqual(actual);
19 | });
20 |
21 | it('expect a list of numbers ', () => {
22 | const expected = [1,2];
23 | const actual = list_numbers(2);
24 |
25 |
26 |
27 |
28 | expect(expected).toEqual(actual);
29 | });
30 |
31 |
32 |
33 | });
34 |
--------------------------------------------------------------------------------
/2019/2019-03-14/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "moviedb",
3 | "version": "1.0.0",
4 | "description": "This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "musesjs",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "mocha": "^6.0.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2019/2019-03-14/api-node-imbd/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | function createMovie(title, description) {
3 | if (!title) {
4 | return 'Enter a title';
5 | }
6 | if (!description) {
7 | return 'Enter a Description';
8 | }
9 | }
10 |
11 | describe('my first test', () => {
12 | it('if the movie have no title return an error', () => {
13 | const actual = createMovie('');
14 | const expected = 'Enter a title';
15 | assert.equal(actual, expected);
16 | });
17 | it('if the movie have no Description return an error', () => {
18 | const actual = createMovie('Star Wars', '');
19 | const expected = 'Enter a Description';
20 | assert.equal(actual, expected);
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/2019/2019-03-28/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "moviedb",
3 | "version": "1.0.0",
4 | "description": "This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "musesjs",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "mocha": "^6.0.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2019/2019-04-11/api-node-imbd/core/create-movie.js:
--------------------------------------------------------------------------------
1 | const createMovie = (database) => {
2 | return (title, description) => {
3 | if (!title && !description) {
4 | return 'Enter a Title and Description';
5 | }
6 | if (!title) {
7 | return 'Enter a title';
8 | }
9 | if (!description) {
10 | return 'Enter a Description';
11 | }
12 | const movies = database.getAllMovies();
13 | if (movies.some((movie) => movie.title == title)) {
14 | return 'Movie already exists.';
15 | }
16 |
17 | return database.saveMovie(title, description);
18 | };
19 | };
20 |
21 | module.exports = createMovie;
22 |
--------------------------------------------------------------------------------
/2019/2019-04-11/api-node-imbd/database/database.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 | mongoose.connect('mongodb://localhost/test', { useNewUrlParser: true });
3 |
--------------------------------------------------------------------------------
/2019/2019-04-11/api-node-imbd/database/database.test.js:
--------------------------------------------------------------------------------
1 | const sinon = require('sinon');
2 | const assert = require('assert');
3 | var mongoose = require('mongoose');
4 | mongoose.connect('mongodb://localhost/test', { useNewUrlParser: true });
5 | describe('databases', () => {
6 | it('Should saved a movie to database', () => {
7 | let actual = saveMovie('Star Wars IV', 'Description');
8 | let expected = 'Star Wars IV is saved into the database!';
9 | assert.equal(actual, expected);
10 | actual = getAllMovies();
11 | expected = 1;
12 | assert.equal(actual.length, expected);
13 | });
14 | });
15 |
16 | function saveMovie(title, description) {}
17 |
--------------------------------------------------------------------------------
/2019/2019-04-11/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "moviedb",
3 | "version": "1.0.0",
4 | "description": "This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w ./*/*.test.js"
8 | },
9 | "author": "musesjs",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "mocha": "^6.1.2",
13 | "sinon": "^7.3.1"
14 | },
15 | "dependencies": {
16 | "mongoose": "^5.5.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/2019/2019-04-11/berlin-clock-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "berlin-clock-kata",
3 | "version": "1.0.0",
4 | "description": "## Problem Description",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "mocha": "^6.1.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/2019/2019-04-11/berlin-clock-kata/test.js:
--------------------------------------------------------------------------------
1 | const assert = require("assert");
2 |
3 | function getSeconds(number) {
4 | return number % 2 === 0 ? "ON" : "OFF";
5 | }
6 |
7 | function getFiveHours(number) {
8 | switch (number / 5) {
9 | case 1:
10 | return "R000";
11 | case 2:
12 | return "RR00";
13 | case 3:
14 | return "RRR0";
15 | case 4:
16 | return "RRRR";
17 | default:
18 | return "0000";
19 | }
20 | }
21 |
22 | describe("Berlin Clock Kata", function() {
23 | it("given odd number return light off", () => {
24 | assert.equal(getSeconds(1), "OFF");
25 | });
26 | it("given even number return light on", () => {
27 | assert.equal(getSeconds(2), "ON");
28 | });
29 |
30 | it("Given number 1 return all lights off", () => {
31 | assert.equal(getFiveHours(1), "0000");
32 | });
33 |
34 | it("Given number 5 return light on", () => {
35 | assert.equal(getFiveHours(5), "R000");
36 | });
37 | it("Given number 10 return light on", () => {
38 | assert.equal(getFiveHours(10), "RR00");
39 | });
40 | });
41 |
--------------------------------------------------------------------------------
/2019/2019-05-02/api-node-imbd/core/create-movie.js:
--------------------------------------------------------------------------------
1 | const createMovie = (database) => {
2 | return (title, description) => {
3 | if (!title && !description) {
4 | return 'Enter a Title and Description';
5 | }
6 | if (!title) {
7 | return 'Enter a title';
8 | }
9 | if (!description) {
10 | return 'Enter a Description';
11 | }
12 | const movies = database.getAllMovies();
13 | if (movies.some((movie) => movie.title == title)) {
14 | return 'Movie already exists.';
15 | }
16 |
17 | return database.saveMovie(title, description);
18 | };
19 | };
20 |
21 | module.exports = createMovie;
22 |
--------------------------------------------------------------------------------
/2019/2019-05-02/api-node-imbd/database/database.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/2019/2019-05-02/api-node-imbd/database/database.js
--------------------------------------------------------------------------------
/2019/2019-05-02/api-node-imbd/database/database.test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | const mongoose = require('mongoose');
3 |
4 | mongoose.connect('mongodb://localhost/MovieDB', { useNewUrlParser: true });
5 | var schema = new mongoose.Schema({ title: 'string', description: 'string' });
6 | var Movie = mongoose.models.Movie || mongoose.model('Movie', schema);
7 |
8 | const DB = {
9 | getAllMovies: () => {},
10 | saveMovie: async (title, description) => {
11 | const result = await Movie.create({ title: title, description: description });
12 | }
13 | };
14 |
15 | describe('databases', () => {
16 | it('Should saved a movie to database', async () => {
17 | let actual = await DB.saveMovie('The Avengers: End Game', 'Description');
18 | let expected = 'Star Wars IV is saved into the database!';
19 | assert.equal(actual, expected);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/2019/2019-05-02/api-node-imbd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "moviedb",
3 | "version": "1.0.0",
4 | "description": "This is a Kata which aims at developing a Node API for creating a personal Movie Database using Test Driven Development[TDD] approach",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w ./*/*.test.js"
8 | },
9 | "author": "musesjs",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "mocha": "^6.1.4",
13 | "sinon": "^7.3.1"
14 | },
15 | "dependencies": {
16 | "mongoose": "^5.5.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/2019/2019-05-16/wordwrap/README.md:
--------------------------------------------------------------------------------
1 | # Word Wrap
2 |
3 | ## Problem Description
4 |
5 | You write a class called Wrapper, that has a single static function named wrap that takes two arguments, a string, and a column number. The function returns the string, but with line breaks inserted at just the right places to make sure that no line is longer than the column number. You try to break lines at word boundaries.
6 |
7 | Like a word processor, break the line by replacing the last space in a line with a newline.
8 |
9 | From: http://codingdojo.org/kata/WordWrap/
10 |
--------------------------------------------------------------------------------
/2019/2019-05-16/wordwrap/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "word-wrap",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/2019/2019-05-16/wordwrap/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | //num = column num
3 | // const wordWrap = (s, w) => s.replace(
4 | // new RegExp(`(?![^\\n]{1,${w}}$)([^\\n]{1,${w}})\\s`, 'g'), '$1\n'
5 | // );
6 | function wordWrap(str, num) {
7 | let result = "";
8 | let lastSpaceIndex
9 | for (let i = 0; i < str.length; i ++) {
10 | if (str[i]===" "){
11 | lastSpaceIndex = i
12 | }
13 | if (i !== 0 && i % num === 0) {
14 | if (str[i]===" "){
15 | result += "\n";
16 | } else {
17 | result += '\n'
18 | str[lastSpaceIndex] = '\n'
19 | }
20 | }
21 | result += str[i];
22 | }
23 | return result;
24 | }
25 |
26 | describe('Word Wrap', () => {
27 |
28 | it('should break at a column number', () => {
29 | const sentence = 'A quick brown fox jumps over a lazy dog';
30 | const columnNumber = 7;
31 | // `` <- template literal
32 | const expected = `A quick\nbrown\nfox\njumps\nover a\nlazy\ndog`;
33 | const actual = wordWrap(sentence, columnNumber);
34 |
35 | assert.equal(actual, expected);
36 | });
37 |
38 | });
39 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing guidelines to the Coding Dojo repo
2 |
3 | ## Proposing a new Kata
4 | If you have any new kata's that you would like to share, you could do the following.
5 | 1. Clone the repository;
6 | 2. Create a new branch for your new Kata;
7 | 3. Add the Kata to the folder `/katas/` (e.g. `/katas/my-new-kata/`).
8 | 4. Open a Pull Request :)
9 |
10 | Once the Pull Request has been approved, you can find your katas in the repository.
11 |
12 | ## Updating an Kata
13 |
14 | **DON'T** push to `master` directly.
15 |
16 | **DO**:
17 | 1. Clone the repository;
18 | 1. Create a branch from `master` and make your changes in it.
19 | 2. Create a PR to master.
20 | 3. Wait for review (you can go to the [Muses Code JS Slack](http://muses-code-js.slack.com/) to announce your changes)
21 | 4. If approved, your changes will be merged by the reviewer(s).
22 |
23 | ## Pushing the work done during a session
24 |
25 | If you're organising a coding-dojo in your chapter, first of all, congratulations and thank you for teaching the best practices to others. We want to keep a clean repository.
26 |
27 | As an organiser, you'll have to share the work done during a session with all of the attendees. To do so, request access to the `coding-dojo` repo on the [Muses Code JS Slack](http://muses-code-js.slack.com/) and then do the following
28 |
29 | **DON'T** push to `master` directly in a folder.
30 |
31 | **DO**:
32 | 1. Create a branch from `master` following the branch naming convention.
33 | 2. Push your changes on Github.
34 | 3. Clean the `katas/` folder. Only keep the katas you've done during the session and delete the others
35 | 3. Create a release tag with the same name as your branch.
36 | 4. Share it with the attendants.
37 |
--------------------------------------------------------------------------------
/katas/acceptance-tests/README.md:
--------------------------------------------------------------------------------
1 | # Acceptance Tests
2 |
3 | ## Problem Description
4 |
5 | "Acceptance tests are created from user stories. The customer specifies scenarios to test when a user story has been correctly implemented. A story can have one or many acceptance tests, what ever it takes to ensure the functionality works.
6 |
7 | Acceptance tests are black box system tests. Each acceptance test represents some expected result from the system. Customers are responsible for verifying the correctness of the acceptance tests and reviewing test scores to decide which failed tests are of highest priority. Acceptance tests are also used as regression tests prior to a production release."
8 |
9 | From: http://www.extremeprogramming.org/rules/functionaltests.html
10 |
11 | ### 1. Choosing website to be tested
12 |
13 | - RealWorld
14 |
15 | ### 2. Writing user stories
16 |
17 | - User Stories
18 |
19 | ### 3. Writing tests
20 |
21 | #### Tests runners
22 |
23 | - Protractor (JavaScript)
24 | - Cypress (JavaScript)
25 |
26 | #### BDD
27 |
28 | - Cucumber
29 |
30 | ### 4. Testing in multiple browsers
31 |
32 | - BrowserStack
33 | - Sauce Labs
--------------------------------------------------------------------------------
/katas/banking-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 8
2 |
--------------------------------------------------------------------------------
/katas/banking-kata/README.md:
--------------------------------------------------------------------------------
1 | # Banking Kata
2 |
3 | ## Problem Description
4 |
5 | Your bank is tired of its mainframe COBOL accounting software and they hired both of you for a greenfield project in - what a happy coincidence: your favorite programming language!
6 |
7 | Your task is to show them that your TDD-fu and your new-age programming language can cope with good ole’ COBOL!
8 |
9 | #### Requirements
10 |
11 | Write a class `Account` that offers the following methods:
12 |
13 | ```
14 | void deposit(int)
15 | void withdraw(int)
16 | String printStatement()
17 | ```
18 |
19 | An example statement would be:
20 |
21 | ```
22 | Date Amount Balance
23 | 24.12.2015 +500 500
24 | 23.8.2016 -100 400
25 | ```
26 |
27 | From: http://kata-log.rocks/banking-kata
28 |
--------------------------------------------------------------------------------
/katas/banking-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "banking-kata",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/banking-kata/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Banking Kata', () => {
4 | it('works', () => {
5 | const expected = true;
6 | const actual = false;
7 |
8 | assert.equal(actual, expected);
9 | });
10 | });
11 |
--------------------------------------------------------------------------------
/katas/bowling-game/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/bowling-game/README.md:
--------------------------------------------------------------------------------
1 | # Bowling Game
2 |
3 | ## Problem Description
4 |
5 | [bowling-score]: http://www.wpclipart.com/recreation/sports/bowling/bowling_scoresheet_example.png "bowling score card"
6 |
7 | ![Bowling scoreboard][bowling-score]
8 |
9 | The game consists of 10 frames as shown above. In each frame the player has
10 | two opportunities to knock down 10 pins. The score for the frame is the total
11 | number of pins knocked down, plus bonuses for strikes and spares.
12 |
13 | A spare is when the player knocks down all 10 pins in two tries. The bonus for
14 | that frame is the number of pins knocked down by the next roll. So in frame 3
15 | above, the score is 10 (the total number knocked down) plus a bonus of 5 (the
16 | number of pins knocked down on the next roll.)
17 |
18 | A strike is when the player knocks down all 10 pins on his first try. The bonus
19 | for that frame is the value of the next two balls rolled.
20 |
21 | In the tenth frame a player who rolls a spare or strike is allowed to roll the extra
22 | balls to complete the frame. However no more than three balls can be rolled in
23 | tenth frame.
24 |
25 |
26 | ## The requirements
27 |
28 | * Write class "BowlingGame" that has two methods
29 | - *roll(pins)*
30 | - called each time the player rolls a ball. The argument is the number of pins knocked down.
31 | - *score()*
32 | - called only after the very end of the game. Returns total score of the game.
33 |
34 | From: https://github.com/hontas/bowling-game-kata
35 |
--------------------------------------------------------------------------------
/katas/bowling-game/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bowling-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/bowling-game/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Bowling Game', function() {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/ceasar-shift-cipher/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/ceasar-shift-cipher/README.md:
--------------------------------------------------------------------------------
1 | # Ceaser Shift Cipher
2 |
3 | ## Problem Description
4 |
5 | Cryptography is one of most interesting branches of programming. Studying its algorithms usually begins with the simple method named after famous Roman emperor Julius Caesar who used it for communicating his military secrets (and perhaps for love letters to Cleopatra).
6 |
7 | Let us Deciphere encrypted Messages
8 |
9 | The idea of the algorithm is simple. Each letter of the original text is substituted by another, by the following rule:
10 |
11 | find the letter (which should be encrypted) in the alphabet;
12 | move ```K ``` positions further (down the alphabet), where K is the Shift value
13 | take the new letter from here;
14 | if "shifting" encountered the end of the algorithm, continue from its start.
15 |
16 | For example, if K = 3 (shift value used by Caesar himself), then A becomes D, B becomes E, W becomes Z and Z becomes C and so on, according to the following table:
17 |
18 | so when K is 3,
19 | YHQL YLGL YLFL should return VENI VIDI VICI.
20 |
21 |
22 | Note:
23 | The value of K can either be pre-determined or got as an input from the user
24 |
25 | From: http://www.codeabbey.com/
26 |
--------------------------------------------------------------------------------
/katas/ceasar-shift-cipher/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ceaser shift cipher",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/ceasar-shift-cipher/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Ceaser Shift Cipher', () => {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/chess-board/README.md:
--------------------------------------------------------------------------------
1 | # Chess board
2 |
3 | ## Problem Description
4 |
5 | Write a program that creates a string that represents an 8×8 grid, using newline characters to separate lines. At each position of the grid there is either a space or a “﹡” character. The characters should form a chess board.
6 |
7 | Passing this string to console.log should show something like this:
8 |
9 | -﹡-﹡-﹡-﹡
10 | ﹡-﹡-﹡-﹡-
11 | -﹡-﹡-﹡-﹡
12 | ﹡-﹡-﹡-﹡-
13 | -﹡-﹡-﹡-﹡
14 | ﹡-﹡-﹡-﹡-
15 | -﹡-﹡-﹡-﹡
16 | ﹡-﹡-﹡-﹡-
17 |
18 | ** Due to the markdown format view, I changed space to dash.
19 |
20 | When you have a program that generates this pattern, define a variable size = 8 and change the program so that it works for any size, outputting a grid of the given width and height.
21 |
22 | ## Hint
23 |
24 | The string can be built by starting with an empty one ("") and repeatedly adding characters. A newline character is written "\n".
25 |
26 | To work with two dimensions, you will need a loop inside of a loop. Put curly braces around the bodies of both loops to make it easy to see where they start and end. Try to properly indent these bodies. The order of the loops must follow the order in which we build up the string (line by line, left to right, top to bottom). So the outer loop handles the lines and the inner loop handles the characters on a line.
27 |
28 | You’ll need two variables to track your progress. To know whether to put a space or a hash sign at a given position, you could test whether the sum of the two counters is even (% 2).
29 |
30 | From: http://eloquentjavascript.net
31 |
--------------------------------------------------------------------------------
/katas/chess-board/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chess-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/chess-board/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 | //This function is just for testing the test describe.
3 | //Either you have to edit this or delete.
4 | var randomFuncYouWillEditLater = function ( x, y) {
5 | var xAxis = 1;
6 | var yAxis = 1;
7 | return xAxis + yAxis;
8 | }
9 |
10 | describe('Chess Board', () => {
11 | it('Test', () => {
12 | const expected = 2;
13 | const actual = randomFuncYouWillEditLater();
14 |
15 | assert.equal(actual, expected);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/katas/fizz-buzz/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/fizz-buzz/README.md:
--------------------------------------------------------------------------------
1 | # Fizz Buzz
2 |
3 | ## Problem Description
4 |
5 | Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more “fun” by introducing a “game”. He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The “fun” part is that if the number is divisible by three, you instead say “Fizz” and if it is divisible by five you say “Buzz”. So now your maths teacher is pointing at all of your classmates in turn, and they happily shout “one!”, “two!”, “Fizz!”, “four!”, “Buzz!”… until he very deliberately points at you, fixing you with a steely gaze… time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak “Fizz!”. Doom is avoided, and the pointing finger moves on.
6 |
7 | So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!
8 |
9 | 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 “.
10 |
11 | Sample output:
12 |
13 | ```
14 | 1
15 | 2
16 | Fizz
17 | 4
18 | Buzz
19 | Fizz
20 | 7
21 | 8
22 | Fizz
23 | Buzz
24 | 11
25 | Fizz
26 | 13
27 | 14
28 | FizzBuzz
29 | 16
30 | 17
31 | Fizz
32 | 19
33 | Buzz
34 | ... etc up to 100
35 | ```
36 |
37 | Stage 2 - new requirements
38 |
39 | ```
40 | * A number is fizz if it is divisible by 3 or if it has a 3 in it
41 | * A number is buzz if it is divisible by 5 or if it has a 5 in it
42 | ```
43 |
44 | From: http://codingdojo.org/kata/FizzBuzz/
45 |
--------------------------------------------------------------------------------
/katas/fizz-buzz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fizz-buzz",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/fizz-buzz/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Fizz Buzz Game', function() {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/gilded-rose-refactoring-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 8
--------------------------------------------------------------------------------
/katas/gilded-rose-refactoring-kata/lib/jasmine-1.1.0/MIT.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2011 Pivotal Labs
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/katas/gilded-rose-refactoring-kata/lib/jasmine-1.1.0/jasmine_favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/katas/gilded-rose-refactoring-kata/lib/jasmine-1.1.0/jasmine_favicon.png
--------------------------------------------------------------------------------
/katas/gilded-rose-refactoring-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gilded-rose-refactoring-kata",
3 | "scripts": {
4 | "test": "light-server --serve . --watchexp '**/*.js'"
5 | },
6 | "devDependencies": {
7 | "light-server": "^2.2.1"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/gilded-rose-refactoring-kata/spec/gilded_rose_spec.js:
--------------------------------------------------------------------------------
1 | describe("Gilded Rose", function() {
2 |
3 | it("should foo", function() {
4 | const gildedRose = new Shop([ new Item("foo", 0, 0) ]);
5 | const items = gildedRose.updateQuality();
6 | expect(items[0].name).toEqual("fixme");
7 | });
8 |
9 | });
--------------------------------------------------------------------------------
/katas/number-letter-counts/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/number-letter-counts/README.md:
--------------------------------------------------------------------------------
1 | # Number Letter Counts
2 |
3 | ## Problem Description
4 |
5 | If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
6 |
7 | Stage 1 - requirements
8 | ```
9 | If all the numbers from 1 to 50 (fifty) inclusive were written out in words, how many letters would be used?
10 | ```
11 |
12 | Stage 2 - requirements
13 | ```
14 | If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
15 | ```
16 |
17 | NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
18 |
19 |
20 | From: https://projecteuler.net/
21 |
--------------------------------------------------------------------------------
/katas/number-letter-counts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "number-letter-counts",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/number-letter-counts/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Number Letter Counts', function() {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/palindrome-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/palindrome-kata/README.md:
--------------------------------------------------------------------------------
1 | # Palindrome
2 |
3 | ## Problem Description
4 |
5 | what is a palindrome ?
6 |
7 | The word or whole phrase which has the same sequence of letters in both directions is called a palindrome. Here are few examples:
8 | ```Stats
9 | Amore, Roma
10 | No 'x' in Nixon
11 | Was it a cat I saw?
12 | ```
13 |
14 | Goal of this exercise is to get the input from the user and determine if that phrase represents a palindrome or not with a 'Yes' or a 'No'
15 |
16 | Note:
17 | case of the letters is ignored.
18 | Spaces and punctuations are ignored too.
19 |
20 | Next Steps:
21 | Work with getting 1 word/ entence from the user at the beginning and once that works get a numnber of phrases as input and then return the output as an array e.g: for 3 phrases -> Y Y N
22 |
23 | From: http://www.codeabbey.com/
24 |
--------------------------------------------------------------------------------
/katas/palindrome-kata/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "palindrome-kata",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/palindrome-kata/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Palindrome', () => {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/prime-factors/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/prime-factors/README.md:
--------------------------------------------------------------------------------
1 | # Prime Factors
2 |
3 | ## Problem Description
4 |
5 | Factorize a positive integer number into its prime factors.
6 |
7 |
8 |
9 | From: https://www.rubyplus.com/articles/511-TDD-Beyond-Basics-Prime-Factors-Kata
10 |
--------------------------------------------------------------------------------
/katas/prime-factors/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prime-factors",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/prime-factors/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Prime factors', () => {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/roman-numerals/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/roman-numerals/README.md:
--------------------------------------------------------------------------------
1 | # Roman Numerals
2 |
3 | ## Problem Description
4 |
5 | The Romans were a clever bunch. They conquered most of Europe and ruled it for
6 | hundreds of years. They invented concrete and straight roads and even bikinis.
7 | One thing they never discovered though was the number zero. This made writing
8 | and dating extensive histories of their exploits slightly more challenging, but
9 | the system of numbers they came up with is still in use today. For example the
10 | BBC uses Roman numerals to date their programmes.
11 |
12 | The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice these
13 | letters have lots of straight lines and are hence easy to hack into stone
14 | tablets).
15 |
16 | The Kata says you should write a function to convert from normal numbers to
17 | Roman Numerals. E.g.:
18 |
19 | 1 -> I
20 | 10 -> X
21 | 7 -> VII
22 |
23 | For a full description of how it works, take a look at
24 | https://en.wikipedia.org/wiki/Roman_numerals
25 |
26 | There is no need to be able to convert numbers larger than about 3000 (the
27 | Romans themselves didn't tend to go any higher). Note that you can't write
28 | numerals like "IM" for 999. Wikipedia says: Modern Roman numerals (…) are
29 | written by expressing each digit separately starting with the left most digit
30 | and skipping any digit with a value of zero. To see this in practice, consider
31 | the (…) example of 1990. In Roman numerals 1990 is rendered: 1000=M, 900=CM,
32 | 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII.
33 |
34 | Here are a few more examples you can use as test cases:
35 |
36 | 1954 -> MCMLIV
37 | 1990 -> MCMXC
38 | 2014 -> MMXIV
39 |
40 | # Extension:
41 |
42 | Write a function to convert in the other direction, i.e. numeral to digit.
43 |
44 | From: http://codingdojo.org/kata/RomanNumerals/
45 |
--------------------------------------------------------------------------------
/katas/roman-numerals/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "roman-numerals",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/roman-numerals/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Roman Numerals', function() {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/scrabble-score/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/scrabble-score/README.md:
--------------------------------------------------------------------------------
1 | # Scrabble Score
2 | Given a word, compute the scrabble score for that word.
3 |
4 | ## Letter Values
5 | You'll need these:
6 | ```
7 | Letter Value
8 | A, E, I, O, U, L, N, R, S, T 1
9 | D, G 2
10 | B, C, M, P 3
11 | F, H, V, W, Y 4
12 | K 5
13 | J, X 8
14 | Q, Z 10
15 | ```
16 | E.g. Javascript should return `24`:
17 | * 8 points for `j`,
18 | * 1 point for `a` twice,
19 | * 4 points for `v`,
20 | * 1 point for `s`,
21 | * 3 points for `c`,
22 | * 1 point for `r`,
23 | * 1 point for `i`,
24 | * 3 points for `p`,
25 | * 1 point for `t`
26 |
27 | Which gives us a total of `24`.
28 |
29 | Inspired from [rchantley's extreme startup game](https://github.com/rchatley/extreme_startup).
30 |
--------------------------------------------------------------------------------
/katas/scrabble-score/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scrabble-scoring-game",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/scrabble-score/test.js:
--------------------------------------------------------------------------------
1 | /* Letter value table
2 | Letter Value
3 | A, E, I, O, U, L, N, R, S, T 1
4 | D, G 2
5 | B, C, M, P 3
6 | F, H, V, W, Y 4
7 | K 5
8 | J, X 8
9 | Q, Z 10
10 | */
11 |
12 | const assert = require('assert');
13 |
14 |
15 | function scrabbleScore(word) {
16 | //your solution
17 | return 0;
18 | }
19 |
20 |
21 | describe('Scrabble scoring game', () => {
22 |
23 | it('scores an empty word as zero', () => {
24 | const expected = 0;
25 | const actual = scrabbleScore('');
26 | assert.equal(actual, expected);
27 | });
28 |
29 | });
30 |
--------------------------------------------------------------------------------
/katas/sum-of-multiples/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/sum-of-multiples/README.md:
--------------------------------------------------------------------------------
1 | # Multiple of 3 and 5
2 |
3 | ## Problem Description
4 |
5 | If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
6 |
7 | Find the sum of all the multiples of 3 or 5 below 1000.
8 |
9 |
10 | From: https://projecteuler.net/
11 |
--------------------------------------------------------------------------------
/katas/sum-of-multiples/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sum-of-multiples",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/sum-of-multiples/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Multiple of 3 and 5', function() {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/tennis-refactoring-kata/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/tennis-refactoring-kata/TennisTest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tennis Test
4 |
5 |
6 | Tests incomplete
7 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/katas/word-wrap/.nvmrc:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/katas/word-wrap/README.md:
--------------------------------------------------------------------------------
1 | # Word Wrap
2 |
3 | ## Problem Description
4 |
5 | You write a class called Wrapper, that has a single static function named wrap that takes two arguments, a string, and a column number. The function returns the string, but with line breaks inserted at just the right places to make sure that no line is longer than the column number. You try to break lines at word boundaries.
6 |
7 | Like a word processor, break the line by replacing the last space in a line with a newline.
8 |
9 | From: http://codingdojo.org/kata/WordWrap/
10 |
--------------------------------------------------------------------------------
/katas/word-wrap/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "word-wrap",
3 | "scripts": {
4 | "test": "mocha -w"
5 | },
6 | "devDependencies": {
7 | "mocha": "3.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/word-wrap/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | describe('Word Wrap', () => {
4 |
5 | it('works', () => {
6 | const expected = true;
7 | const actual = false;
8 |
9 | assert.equal(actual, expected);
10 | });
11 |
12 | });
13 |
--------------------------------------------------------------------------------
/katas/yatzy-refactoring/.nvmrc:
--------------------------------------------------------------------------------
1 | lts/carbon
2 |
--------------------------------------------------------------------------------
/katas/yatzy-refactoring/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "yatzy-refactoring-kata",
3 | "version": "0.0.1",
4 | "description": "Code for a refactoring exercise about the game of Yatzy",
5 | "dependencies": {},
6 | "devDependencies": {
7 | "mocha": "~1.17"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/katas/yatzy/.nvmrc:
--------------------------------------------------------------------------------
1 | lts/carbon
2 |
--------------------------------------------------------------------------------
/katas/yatzy/index.js:
--------------------------------------------------------------------------------
1 | function Yatzy(){}
2 |
3 | module.exports = yatzy;
--------------------------------------------------------------------------------
/katas/yatzy/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "yatzy",
3 | "version": "1.0.0",
4 | "description": "This Refactoring Kata was designed by Jon Jagger and is available in his Cyber-Dojo. See [his blog post](http://jonjagger.blogspot.co.uk/2012/05/yahtzee-cyber-dojo-refactoring-in-java.html)",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -w"
8 | },
9 | "devDependencies": {
10 | "mocha": "3.2.0"
11 | },
12 | "dependencies": {
13 | "chai": "^4.1.2"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/katas/yatzy/test.js:
--------------------------------------------------------------------------------
1 | const assert = require('chai').assert
2 |
3 | const Yatzy = require('./index')
4 |
5 | describe('Yatzi game', () => {
6 | it('should be fixed', () => {
7 | assert(false).to.be.true
8 | })
9 | })
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/logo.png
--------------------------------------------------------------------------------
/logo_muses_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/logo_muses_color.png
--------------------------------------------------------------------------------
/slides/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | *.iml
3 | *.iws
4 | *.eml
5 | out/
6 | .DS_Store
7 | .svn
8 | log/*.log
9 | tmp/**
10 | node_modules/
11 | package-lock.json
12 | .sass-cache
13 | css/reveal.min.css
14 | js/reveal.min.js
15 |
--------------------------------------------------------------------------------
/slides/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 4
4 | after_script:
5 | - npm run build -- retire
6 |
--------------------------------------------------------------------------------
/slides/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**.
4 |
5 |
6 | ### Personal Support
7 | If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js).
8 |
9 |
10 | ### Bug Reports
11 | When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested.
12 |
13 |
14 | ### Pull Requests
15 | - Should follow the coding style of the file you work in, most importantly:
16 | - Tabs to indent
17 | - Single-quoted strings
18 | - Should be made towards the **dev branch**
19 | - Should be submitted from a feature/topic branch (not your master)
20 |
21 |
22 | ### Plugins
23 | Please do not submit plugins as pull requests. They should be maintained in their own separate repository. More information here: https://github.com/hakimel/reveal.js/wiki/Plugin-Guidelines
24 |
--------------------------------------------------------------------------------
/slides/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2018 Hakim El Hattab, http://hakim.se, and reveal.js contributors
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/slides/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reveal.js",
3 | "version": "3.7.0",
4 | "main": [
5 | "js/reveal.js",
6 | "css/reveal.css"
7 | ],
8 | "homepage": "http://revealjs.com",
9 | "license": "MIT",
10 | "description": "The HTML Presentation Framework",
11 | "authors": [
12 | "Hakim El Hattab "
13 | ],
14 | "dependencies": {
15 | "headjs": "~1.0.3"
16 | },
17 | "repository": {
18 | "type": "git",
19 | "url": "git://github.com/hakimel/reveal.js.git"
20 | },
21 | "ignore": [
22 | "**/.*",
23 | "node_modules",
24 | "bower_components",
25 | "test"
26 | ]
27 | }
--------------------------------------------------------------------------------
/slides/css/theme/README.md:
--------------------------------------------------------------------------------
1 | ## Dependencies
2 |
3 | Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceeding: https://github.com/hakimel/reveal.js#full-setup
4 |
5 | ## Creating a Theme
6 |
7 | To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js)) when you run `npm run build -- css-themes`.
8 |
9 | Each theme file does four things in the following order:
10 |
11 | 1. **Include [/css/theme/template/mixins.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/mixins.scss)**
12 | Shared utility functions.
13 |
14 | 2. **Include [/css/theme/template/settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss)**
15 | Declares a set of custom variables that the template file (step 4) expects. Can be overridden in step 3.
16 |
17 | 3. **Override**
18 | This is where you override the default theme. Either by specifying variables (see [settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss) for reference) or by adding any selectors and styles you please.
19 |
20 | 4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)**
21 | The template theme file which will generate final CSS output based on the currently defined variables.
22 |
--------------------------------------------------------------------------------
/slides/css/theme/source/beige.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Beige theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 |
15 | // Include theme-specific fonts
16 | @import url(../../lib/font/league-gothic/league-gothic.css);
17 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
18 |
19 |
20 | // Override theme settings (see ../template/settings.scss)
21 | $mainColor: #333;
22 | $headingColor: #333;
23 | $headingTextShadow: none;
24 | $backgroundColor: #f7f3de;
25 | $linkColor: #8b743d;
26 | $linkColorHover: lighten( $linkColor, 20% );
27 | $selectionBackgroundColor: rgba(79, 64, 28, 0.99);
28 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15);
29 |
30 | // Background generator
31 | @mixin bodyBackground() {
32 | @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) );
33 | }
34 |
35 |
36 |
37 | // Theme template ------------------------------
38 | @import "../template/theme";
39 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/black.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Black theme for reveal.js. This is the opposite of the 'white' theme.
3 | *
4 | * By Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css);
16 |
17 |
18 | // Override theme settings (see ../template/settings.scss)
19 | $backgroundColor: #222;
20 |
21 | $mainColor: #fff;
22 | $headingColor: #fff;
23 |
24 | $mainFontSize: 42px;
25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif;
26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif;
27 | $headingTextShadow: none;
28 | $headingLetterSpacing: normal;
29 | $headingTextTransform: uppercase;
30 | $headingFontWeight: 600;
31 | $linkColor: #42affa;
32 | $linkColorHover: lighten( $linkColor, 15% );
33 | $selectionBackgroundColor: lighten( $linkColor, 25% );
34 |
35 | $heading1Size: 2.5em;
36 | $heading2Size: 1.6em;
37 | $heading3Size: 1.3em;
38 | $heading4Size: 1.0em;
39 |
40 | section.has-light-background {
41 | &, h1, h2, h3, h4, h5, h6 {
42 | color: #222;
43 | }
44 | }
45 |
46 |
47 | // Theme template ------------------------------
48 | @import "../template/theme";
49 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/league.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * League theme for reveal.js.
3 | *
4 | * This was the default theme pre-3.0.0.
5 | *
6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
7 | */
8 |
9 |
10 | // Default mixins and settings -----------------
11 | @import "../template/mixins";
12 | @import "../template/settings";
13 | // ---------------------------------------------
14 |
15 |
16 |
17 | // Include theme-specific fonts
18 | @import url(../../lib/font/league-gothic/league-gothic.css);
19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
20 |
21 | // Override theme settings (see ../template/settings.scss)
22 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2);
23 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15);
24 |
25 | // Background generator
26 | @mixin bodyBackground() {
27 | @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) );
28 | }
29 |
30 |
31 |
32 | // Theme template ------------------------------
33 | @import "../template/theme";
34 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/moon.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Solarized Dark theme for reveal.js.
3 | * Author: Achim Staebler
4 | */
5 |
6 |
7 | // Default mixins and settings -----------------
8 | @import "../template/mixins";
9 | @import "../template/settings";
10 | // ---------------------------------------------
11 |
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/league-gothic/league-gothic.css);
16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
17 |
18 | /**
19 | * Solarized colors by Ethan Schoonover
20 | */
21 | html * {
22 | color-profile: sRGB;
23 | rendering-intent: auto;
24 | }
25 |
26 | // Solarized colors
27 | $base03: #002b36;
28 | $base02: #073642;
29 | $base01: #586e75;
30 | $base00: #657b83;
31 | $base0: #839496;
32 | $base1: #93a1a1;
33 | $base2: #eee8d5;
34 | $base3: #fdf6e3;
35 | $yellow: #b58900;
36 | $orange: #cb4b16;
37 | $red: #dc322f;
38 | $magenta: #d33682;
39 | $violet: #6c71c4;
40 | $blue: #268bd2;
41 | $cyan: #2aa198;
42 | $green: #859900;
43 |
44 | // Override theme settings (see ../template/settings.scss)
45 | $mainColor: $base1;
46 | $headingColor: $base2;
47 | $headingTextShadow: none;
48 | $backgroundColor: $base03;
49 | $linkColor: $blue;
50 | $linkColorHover: lighten( $linkColor, 20% );
51 | $selectionBackgroundColor: $magenta;
52 |
53 |
54 |
55 | // Theme template ------------------------------
56 | @import "../template/theme";
57 | // ---------------------------------------------
58 |
--------------------------------------------------------------------------------
/slides/css/theme/source/night.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Black theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700);
16 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic);
17 |
18 |
19 | // Override theme settings (see ../template/settings.scss)
20 | $backgroundColor: #111;
21 |
22 | $mainFont: 'Open Sans', sans-serif;
23 | $linkColor: #e7ad52;
24 | $linkColorHover: lighten( $linkColor, 20% );
25 | $headingFont: 'Montserrat', Impact, sans-serif;
26 | $headingTextShadow: none;
27 | $headingLetterSpacing: -0.03em;
28 | $headingTextTransform: none;
29 | $selectionBackgroundColor: #e7ad52;
30 |
31 |
32 | // Theme template ------------------------------
33 | @import "../template/theme";
34 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/serif.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is brown.
4 | *
5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed.
6 | */
7 |
8 |
9 | // Default mixins and settings -----------------
10 | @import "../template/mixins";
11 | @import "../template/settings";
12 | // ---------------------------------------------
13 |
14 |
15 |
16 | // Override theme settings (see ../template/settings.scss)
17 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
18 | $mainColor: #000;
19 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
20 | $headingColor: #383D3D;
21 | $headingTextShadow: none;
22 | $headingTextTransform: none;
23 | $backgroundColor: #F0F1EB;
24 | $linkColor: #51483D;
25 | $linkColorHover: lighten( $linkColor, 20% );
26 | $selectionBackgroundColor: #26351C;
27 |
28 | .reveal a {
29 | line-height: 1.3em;
30 | }
31 |
32 |
33 | // Theme template ------------------------------
34 | @import "../template/theme";
35 | // ---------------------------------------------
36 |
--------------------------------------------------------------------------------
/slides/css/theme/source/simple.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is darkblue.
4 | *
5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed.
6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
7 | */
8 |
9 |
10 | // Default mixins and settings -----------------
11 | @import "../template/mixins";
12 | @import "../template/settings";
13 | // ---------------------------------------------
14 |
15 |
16 |
17 | // Include theme-specific fonts
18 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);
19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
20 |
21 |
22 | // Override theme settings (see ../template/settings.scss)
23 | $mainFont: 'Lato', sans-serif;
24 | $mainColor: #000;
25 | $headingFont: 'News Cycle', Impact, sans-serif;
26 | $headingColor: #000;
27 | $headingTextShadow: none;
28 | $headingTextTransform: none;
29 | $backgroundColor: #fff;
30 | $linkColor: #00008B;
31 | $linkColorHover: lighten( $linkColor, 20% );
32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99);
33 |
34 | section.has-dark-background {
35 | &, h1, h2, h3, h4, h5, h6 {
36 | color: #fff;
37 | }
38 | }
39 |
40 |
41 | // Theme template ------------------------------
42 | @import "../template/theme";
43 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/sky.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Sky theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 |
15 | // Include theme-specific fonts
16 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic);
17 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
18 |
19 |
20 | // Override theme settings (see ../template/settings.scss)
21 | $mainFont: 'Open Sans', sans-serif;
22 | $mainColor: #333;
23 | $headingFont: 'Quicksand', sans-serif;
24 | $headingColor: #333;
25 | $headingLetterSpacing: -0.08em;
26 | $headingTextShadow: none;
27 | $backgroundColor: #f7fbfc;
28 | $linkColor: #3b759e;
29 | $linkColorHover: lighten( $linkColor, 20% );
30 | $selectionBackgroundColor: #134674;
31 |
32 | // Fix links so they are not cut off
33 | .reveal a {
34 | line-height: 1.3em;
35 | }
36 |
37 | // Background generator
38 | @mixin bodyBackground() {
39 | @include radial-gradient( #add9e4, #f7fbfc );
40 | }
41 |
42 |
43 |
44 | // Theme template ------------------------------
45 | @import "../template/theme";
46 | // ---------------------------------------------
47 |
--------------------------------------------------------------------------------
/slides/css/theme/source/solarized.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Solarized Light theme for reveal.js.
3 | * Author: Achim Staebler
4 | */
5 |
6 |
7 | // Default mixins and settings -----------------
8 | @import "../template/mixins";
9 | @import "../template/settings";
10 | // ---------------------------------------------
11 |
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/league-gothic/league-gothic.css);
16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
17 |
18 |
19 | /**
20 | * Solarized colors by Ethan Schoonover
21 | */
22 | html * {
23 | color-profile: sRGB;
24 | rendering-intent: auto;
25 | }
26 |
27 | // Solarized colors
28 | $base03: #002b36;
29 | $base02: #073642;
30 | $base01: #586e75;
31 | $base00: #657b83;
32 | $base0: #839496;
33 | $base1: #93a1a1;
34 | $base2: #eee8d5;
35 | $base3: #fdf6e3;
36 | $yellow: #b58900;
37 | $orange: #cb4b16;
38 | $red: #dc322f;
39 | $magenta: #d33682;
40 | $violet: #6c71c4;
41 | $blue: #268bd2;
42 | $cyan: #2aa198;
43 | $green: #859900;
44 |
45 | // Override theme settings (see ../template/settings.scss)
46 | $mainColor: $base00;
47 | $headingColor: $base01;
48 | $headingTextShadow: none;
49 | $backgroundColor: $base3;
50 | $linkColor: $blue;
51 | $linkColorHover: lighten( $linkColor, 20% );
52 | $selectionBackgroundColor: $magenta;
53 |
54 | // Background generator
55 | // @mixin bodyBackground() {
56 | // @include radial-gradient( rgba($base3,1), rgba(lighten($base3, 20%),1) );
57 | // }
58 |
59 |
60 |
61 | // Theme template ------------------------------
62 | @import "../template/theme";
63 | // ---------------------------------------------
64 |
--------------------------------------------------------------------------------
/slides/css/theme/source/white.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * White theme for reveal.js. This is the opposite of the 'black' theme.
3 | *
4 | * By Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css);
16 |
17 |
18 | // Override theme settings (see ../template/settings.scss)
19 | $backgroundColor: #fff;
20 |
21 | $mainColor: #222;
22 | $headingColor: #222;
23 |
24 | $mainFontSize: 42px;
25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif;
26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif;
27 | $headingTextShadow: none;
28 | $headingLetterSpacing: normal;
29 | $headingTextTransform: uppercase;
30 | $headingFontWeight: 600;
31 | $linkColor: #2a76dd;
32 | $linkColorHover: lighten( $linkColor, 15% );
33 | $selectionBackgroundColor: lighten( $linkColor, 25% );
34 |
35 | $heading1Size: 2.5em;
36 | $heading2Size: 1.6em;
37 | $heading3Size: 1.3em;
38 | $heading4Size: 1.0em;
39 |
40 | section.has-dark-background {
41 | &, h1, h2, h3, h4, h5, h6 {
42 | color: #fff;
43 | }
44 | }
45 |
46 |
47 | // Theme template ------------------------------
48 | @import "../template/theme";
49 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/template/mixins.scss:
--------------------------------------------------------------------------------
1 | @mixin vertical-gradient( $top, $bottom ) {
2 | background: $top;
3 | background: -moz-linear-gradient( top, $top 0%, $bottom 100% );
4 | background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) );
5 | background: -webkit-linear-gradient( top, $top 0%, $bottom 100% );
6 | background: -o-linear-gradient( top, $top 0%, $bottom 100% );
7 | background: -ms-linear-gradient( top, $top 0%, $bottom 100% );
8 | background: linear-gradient( top, $top 0%, $bottom 100% );
9 | }
10 |
11 | @mixin horizontal-gradient( $top, $bottom ) {
12 | background: $top;
13 | background: -moz-linear-gradient( left, $top 0%, $bottom 100% );
14 | background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) );
15 | background: -webkit-linear-gradient( left, $top 0%, $bottom 100% );
16 | background: -o-linear-gradient( left, $top 0%, $bottom 100% );
17 | background: -ms-linear-gradient( left, $top 0%, $bottom 100% );
18 | background: linear-gradient( left, $top 0%, $bottom 100% );
19 | }
20 |
21 | @mixin radial-gradient( $outer, $inner, $type: circle ) {
22 | background: $outer;
23 | background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
24 | background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) );
25 | background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
26 | background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
27 | background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
28 | background: radial-gradient( center, $type cover, $inner 0%, $outer 100% );
29 | }
--------------------------------------------------------------------------------
/slides/css/theme/template/settings.scss:
--------------------------------------------------------------------------------
1 | // Base settings for all themes that can optionally be
2 | // overridden by the super-theme
3 |
4 | // Background of the presentation
5 | $backgroundColor: #2b2b2b;
6 |
7 | // Primary/body text
8 | $mainFont: 'Lato', sans-serif;
9 | $mainFontSize: 40px;
10 | $mainColor: #eee;
11 |
12 | // Vertical spacing between blocks of text
13 | $blockMargin: 20px;
14 |
15 | // Headings
16 | $headingMargin: 0 0 $blockMargin 0;
17 | $headingFont: 'League Gothic', Impact, sans-serif;
18 | $headingColor: #eee;
19 | $headingLineHeight: 1.2;
20 | $headingLetterSpacing: normal;
21 | $headingTextTransform: uppercase;
22 | $headingTextShadow: none;
23 | $headingFontWeight: normal;
24 | $heading1TextShadow: $headingTextShadow;
25 |
26 | $heading1Size: 3.77em;
27 | $heading2Size: 2.11em;
28 | $heading3Size: 1.55em;
29 | $heading4Size: 1.00em;
30 |
31 | // Links and actions
32 | $linkColor: #13DAEC;
33 | $linkColorHover: lighten( $linkColor, 20% );
34 |
35 | // Text selection
36 | $selectionBackgroundColor: #FF5E99;
37 | $selectionColor: #fff;
38 |
39 | // Generates the presentation background, can be overridden
40 | // to return a background image or gradient
41 | @mixin bodyBackground() {
42 | background: $backgroundColor;
43 | }
--------------------------------------------------------------------------------
/slides/img/kisspng-ninja-computer-programming-learning-study-skills-avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/img/kisspng-ninja-computer-programming-learning-study-skills-avatar.png
--------------------------------------------------------------------------------
/slides/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/img/logo.png
--------------------------------------------------------------------------------
/slides/img/logo_muses_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/img/logo_muses_color.png
--------------------------------------------------------------------------------
/slides/img/red-green-refactor.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/img/red-green-refactor.jpg
--------------------------------------------------------------------------------
/slides/lib/css/zenburn.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov
4 | based on dark.css by Ivan Sagalaev
5 |
6 | */
7 |
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | background: #3f3f3f;
13 | color: #dcdcdc;
14 | }
15 |
16 | .hljs-keyword,
17 | .hljs-selector-tag,
18 | .hljs-tag {
19 | color: #e3ceab;
20 | }
21 |
22 | .hljs-template-tag {
23 | color: #dcdcdc;
24 | }
25 |
26 | .hljs-number {
27 | color: #8cd0d3;
28 | }
29 |
30 | .hljs-variable,
31 | .hljs-template-variable,
32 | .hljs-attribute {
33 | color: #efdcbc;
34 | }
35 |
36 | .hljs-literal {
37 | color: #efefaf;
38 | }
39 |
40 | .hljs-subst {
41 | color: #8f8f8f;
42 | }
43 |
44 | .hljs-title,
45 | .hljs-name,
46 | .hljs-selector-id,
47 | .hljs-selector-class,
48 | .hljs-section,
49 | .hljs-type {
50 | color: #efef8f;
51 | }
52 |
53 | .hljs-symbol,
54 | .hljs-bullet,
55 | .hljs-link {
56 | color: #dca3a3;
57 | }
58 |
59 | .hljs-deletion,
60 | .hljs-string,
61 | .hljs-built_in,
62 | .hljs-builtin-name {
63 | color: #cc9393;
64 | }
65 |
66 | .hljs-addition,
67 | .hljs-comment,
68 | .hljs-quote,
69 | .hljs-meta {
70 | color: #7f9f7f;
71 | }
72 |
73 |
74 | .hljs-emphasis {
75 | font-style: italic;
76 | }
77 |
78 | .hljs-strong {
79 | font-weight: bold;
80 | }
81 |
--------------------------------------------------------------------------------
/slides/lib/font/league-gothic/LICENSE:
--------------------------------------------------------------------------------
1 | SIL Open Font License (OFL)
2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
3 |
--------------------------------------------------------------------------------
/slides/lib/font/league-gothic/league-gothic.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'League Gothic';
3 | src: url('league-gothic.eot');
4 | src: url('league-gothic.eot?#iefix') format('embedded-opentype'),
5 | url('league-gothic.woff') format('woff'),
6 | url('league-gothic.ttf') format('truetype');
7 |
8 | font-weight: normal;
9 | font-style: normal;
10 | }
--------------------------------------------------------------------------------
/slides/lib/font/league-gothic/league-gothic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/league-gothic/league-gothic.eot
--------------------------------------------------------------------------------
/slides/lib/font/league-gothic/league-gothic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/league-gothic/league-gothic.ttf
--------------------------------------------------------------------------------
/slides/lib/font/league-gothic/league-gothic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/league-gothic/league-gothic.woff
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-italic.eot
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-italic.ttf
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-italic.woff
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-regular.eot
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-regular.ttf
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-regular.woff
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-semibold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-semibold.eot
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-semibold.ttf
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-semibold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-semibold.woff
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff
--------------------------------------------------------------------------------
/slides/lib/font/source-sans-pro/source-sans-pro.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Source Sans Pro';
3 | src: url('source-sans-pro-regular.eot');
4 | src: url('source-sans-pro-regular.eot?#iefix') format('embedded-opentype'),
5 | url('source-sans-pro-regular.woff') format('woff'),
6 | url('source-sans-pro-regular.ttf') format('truetype');
7 | font-weight: normal;
8 | font-style: normal;
9 | }
10 |
11 | @font-face {
12 | font-family: 'Source Sans Pro';
13 | src: url('source-sans-pro-italic.eot');
14 | src: url('source-sans-pro-italic.eot?#iefix') format('embedded-opentype'),
15 | url('source-sans-pro-italic.woff') format('woff'),
16 | url('source-sans-pro-italic.ttf') format('truetype');
17 | font-weight: normal;
18 | font-style: italic;
19 | }
20 |
21 | @font-face {
22 | font-family: 'Source Sans Pro';
23 | src: url('source-sans-pro-semibold.eot');
24 | src: url('source-sans-pro-semibold.eot?#iefix') format('embedded-opentype'),
25 | url('source-sans-pro-semibold.woff') format('woff'),
26 | url('source-sans-pro-semibold.ttf') format('truetype');
27 | font-weight: 600;
28 | font-style: normal;
29 | }
30 |
31 | @font-face {
32 | font-family: 'Source Sans Pro';
33 | src: url('source-sans-pro-semibolditalic.eot');
34 | src: url('source-sans-pro-semibolditalic.eot?#iefix') format('embedded-opentype'),
35 | url('source-sans-pro-semibolditalic.woff') format('woff'),
36 | url('source-sans-pro-semibolditalic.ttf') format('truetype');
37 | font-weight: 600;
38 | font-style: italic;
39 | }
--------------------------------------------------------------------------------
/slides/lib/js/classList.js:
--------------------------------------------------------------------------------
1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p=4.0.0"
24 | },
25 | "devDependencies": {
26 | "express": "^4.16.2",
27 | "grunt": "^1.0.1",
28 | "grunt-autoprefixer": "^3.0.4",
29 | "grunt-cli": "^1.2.0",
30 | "grunt-contrib-connect": "^1.0.2",
31 | "grunt-contrib-cssmin": "^2.2.1",
32 | "grunt-contrib-jshint": "^1.1.0",
33 | "grunt-contrib-qunit": "^2.0.0",
34 | "grunt-contrib-uglify": "^3.3.0",
35 | "grunt-contrib-watch": "^1.0.0",
36 | "grunt-sass": "^2.0.0",
37 | "grunt-retire": "^1.0.7",
38 | "grunt-zip": "~0.17.1",
39 | "mustache": "^2.3.0",
40 | "socket.io": "^1.7.3"
41 | },
42 | "license": "MIT"
43 | }
44 |
--------------------------------------------------------------------------------
/slides/plugin/markdown/example.md:
--------------------------------------------------------------------------------
1 | # Markdown Demo
2 |
3 |
4 |
5 | ## External 1.1
6 |
7 | Content 1.1
8 |
9 | Note: This will only appear in the speaker notes window.
10 |
11 |
12 | ## External 1.2
13 |
14 | Content 1.2
15 |
16 |
17 |
18 | ## External 2
19 |
20 | Content 2.1
21 |
22 |
23 |
24 | ## External 3.1
25 |
26 | Content 3.1
27 |
28 |
29 | ## External 3.2
30 |
31 | Content 3.2
32 |
33 |
34 | ## External 3.3
35 |
36 | 
37 |
--------------------------------------------------------------------------------
/slides/plugin/multiplex/client.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var multiplex = Reveal.getConfig().multiplex;
3 | var socketId = multiplex.id;
4 | var socket = io.connect(multiplex.url);
5 |
6 | socket.on(multiplex.id, function(data) {
7 | // ignore data from sockets that aren't ours
8 | if (data.socketId !== socketId) { return; }
9 | if( window.location.host === 'localhost:1947' ) return;
10 |
11 | Reveal.setState(data.state);
12 | });
13 | }());
14 |
--------------------------------------------------------------------------------
/slides/plugin/multiplex/master.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | // Don't emit events from inside of notes windows
4 | if ( window.location.search.match( /receiver/gi ) ) { return; }
5 |
6 | var multiplex = Reveal.getConfig().multiplex;
7 |
8 | var socket = io.connect( multiplex.url );
9 |
10 | function post() {
11 |
12 | var messageData = {
13 | state: Reveal.getState(),
14 | secret: multiplex.secret,
15 | socketId: multiplex.id
16 | };
17 |
18 | socket.emit( 'multiplex-statechanged', messageData );
19 |
20 | };
21 |
22 | // post once the page is loaded, so the client follows also on "open URL".
23 | window.addEventListener( 'load', post );
24 |
25 | // Monitor events that trigger a change in state
26 | Reveal.addEventListener( 'slidechanged', post );
27 | Reveal.addEventListener( 'fragmentshown', post );
28 | Reveal.addEventListener( 'fragmenthidden', post );
29 | Reveal.addEventListener( 'overviewhidden', post );
30 | Reveal.addEventListener( 'overviewshown', post );
31 | Reveal.addEventListener( 'paused', post );
32 | Reveal.addEventListener( 'resumed', post );
33 |
34 | }());
35 |
--------------------------------------------------------------------------------
/slides/plugin/multiplex/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reveal-js-multiplex",
3 | "version": "1.0.0",
4 | "description": "reveal.js multiplex server",
5 | "homepage": "http://revealjs.com",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "engines": {
10 | "node": "~4.1.1"
11 | },
12 | "dependencies": {
13 | "express": "~4.13.3",
14 | "grunt-cli": "~0.1.13",
15 | "mustache": "~2.2.1",
16 | "socket.io": "~1.3.7"
17 | },
18 | "license": "MIT"
19 | }
20 |
--------------------------------------------------------------------------------
/slides/test/examples/assets/image1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/test/examples/assets/image1.png
--------------------------------------------------------------------------------
/slides/test/examples/assets/image2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/muses-code-js/coding-dojo/7221691e212a7c20bb322102db8b088fffd61a2e/slides/test/examples/assets/image2.png
--------------------------------------------------------------------------------
/slides/test/examples/barebones.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Barebones
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | Barebones Presentation
20 | This example contains the bare minimum includes and markup required to run a reveal.js presentation.
21 |
22 |
23 |
24 | No Theme
25 | There's no theme included, so it will fall back on browser defaults.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/slides/test/examples/embedded-media.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Embedded Media
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Embedded Media Test
23 |
24 |
25 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/slides/test/simple.md:
--------------------------------------------------------------------------------
1 | ## Slide 1.1
2 |
3 | ```js
4 | var a = 1;
5 | ```
6 |
7 |
8 | ## Slide 1.2
9 |
10 |
11 |
12 | ## Slide 2
13 |
--------------------------------------------------------------------------------
/slides/test/test-markdown-external.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/slides/test/test-markdown-external.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Vertical separator', function( assert ) {
6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
7 | });
8 |
9 | QUnit.test( 'Horizontal separator', function( assert ) {
10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section' ).length, 2, 'found two slides' );
11 | });
12 |
13 | QUnit.test( 'Language highlighter', function( assert ) {
14 | assert.strictEqual( document.querySelectorAll( '.hljs-keyword' ).length, 1, 'got rendered highlight tag.' );
15 | assert.strictEqual( document.querySelector( '.hljs-keyword' ).innerHTML, 'var', 'the same keyword: var.' );
16 | });
17 |
18 | } );
19 |
20 | Reveal.initialize();
21 |
--------------------------------------------------------------------------------
/slides/test/test-markdown-options.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown Options
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/slides/test/test-markdown-options.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Options are set', function( assert ) {
6 | assert.strictEqual( marked.defaults.smartypants, true );
7 | });
8 |
9 | QUnit.test( 'Smart quotes are activated', function( assert ) {
10 | var text = document.querySelector( '.reveal .slides>section>p' ).textContent;
11 |
12 | assert.strictEqual( /['"]/.test( text ), false );
13 | assert.strictEqual( /[“”‘’]/.test( text ), true );
14 | });
15 |
16 | } );
17 |
18 | Reveal.initialize({
19 | dependencies: [
20 | { src: '../plugin/markdown/marked.js' },
21 | // Test loading JS files with query strings
22 | { src: '../plugin/markdown/markdown.js?query=string' },
23 | ],
24 | markdown: {
25 | smartypants: true
26 | }
27 | });
28 |
--------------------------------------------------------------------------------
/slides/test/test-markdown.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/slides/test/test-markdown.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Vertical separator', function( assert ) {
6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
7 | });
8 |
9 | } );
10 |
11 | Reveal.initialize();
12 |
--------------------------------------------------------------------------------
/slides/test/test-pdf.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | // Only one test for now, we're mainly ensuring that there
4 | // are no execution errors when running PDF mode
5 |
6 | QUnit.test( 'Reveal.isReady', function( assert ) {
7 | assert.strictEqual( Reveal.isReady(), true, 'returns true' );
8 | });
9 |
10 | } );
11 |
12 | Reveal.initialize({ pdf: true });
13 |
--------------------------------------------------------------------------------