A (silly) HTTP API for doing FizzBuzz stuff.
Copyright (c) 2014–2015 Scott Zeid.
http://code.s.zeid.me/fizzbuzz-http
See it in action:
- PHP client: http://fizzbuzz-http.s.zeid.me/client.php.
- HTML/JS client: http://fizzbuzz-http.s.zeid.me/client.html.
The notation used to denote in-URL parameters is :param
, where param
is
the name of the parameter. All methods output a JSON literal upon success.
With the included PHP implementation, the method and parameters are passed
as the query string—for example, server.php?/divisible-by/15/5
.
Returns the integer at which the counter should start counting
(currently 1
).
Returns the integer after which the counter should stop counting
(currently 100
).
Returns the integer by which the counter should increment after each iteration
(currently 1
).
Returns true
if a
is divisible by b
and false
otherwise.
Returns information about fizz
. Acceptable values for what
are:
-
number
:
Returns the number that corresponds tofizz
(currently3
). -
text
:
Returns the output string that corresponds tofizz
(currentlyFizz
).
Returns information about buzz
. Acceptable values for what
are:
-
number
:
Returns the number that corresponds tobuzz
(currently5
). -
text
:
Returns the output string that corresponds tobuzz
(currentlyBuzz
).