johnkary/rethinking-loops

Supplemental code and practice katas for John Karyโ€™s talk Rethinking Loops.

Maintainers

๐Ÿ‘ johnkary

Package info

github.com/johnkary/rethinkingloops

Language:CSS

pkg:composer/johnkary/rethinking-loops

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 1

v1.0.0 2016-03-05 04:38 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 9d373dfe42c80016c514f0c18f7275e7dcf73b99

  • John Kary <john.woop@johnkary.net>
  • Eric Poe <eric.poe.woop@gmail.com>

This package is auto-updated.

Last update: 2026-06-06 13:29:39 UTC


README

Playground for ideas presented in John Kary's talk Rethinking Loops. Can you implement these kata's without using loops? Without control statements?

Viewing Slides

$ git clone https://github.com/johnkary/rethinkingloops.git rethinkingloops
$ cd !$
$ php -S 127.0.0.1:4000 -t slides/
$ open http://127.0.0.1:4000

Install for working on katas

Create a new project based on this project using Composer.

$ composer create-project johnkary/rethinking-loops
$ cd rethinking-loops

Writing Katas

Run the unit tests. The failing tests show which katas you have yet to implement:

$ vendor/bin/phpunit

Open your editor and begin hacking on one of the katas.

  • Fizz Buzz
    • Haystack\FizzBuzz
  • Some other kata?

Re-run the unit tests. If tests pass your implementation works!

Kata: FizzBuzz

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".

Run all tests for Fizz Buzz.

$ vendor/bin/phpunit tests/FizzBuzzTest.php