This language bar is your friend. Select your favorite languages!

Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

#Edit dateEdit SummaryEditor
👁 Δ 56 2019-10-14, 12:23 [Elixir] Dead link: play.elixirbyexample.com has been down for a while programming-idioms.org
👁 Δ 55 2019-09-26, 22:27 [PHP] Format code snippet to PSR-12 ancarda
👁 Δ 54 2019-09-26, 21:54 New Kotlin implementation by user [miguel] miguel
👁 Δ 53 2019-09-26, 21:54 New Kotlin implementation by user [miguel] miguel
👁 Δ 52 2019-09-26, 19:25 New Fortran implementation by user [tkoenig] tkoenig
👁 Δ 51 2019-09-26, 15:02 New Lisp implementation by user [foobar] foobar
👁 Δ 50 2019-09-26, 14:44 [PHP] There's hardly any need for an else if we have 2 returns. jesusflores.dev
👁 Δ 49 2019-09-26, 14:36 New JS implementation by user [f] f
👁 Δ 48 2019-09-26, 14:01 New PHP implementation by user [nek] nek
👁 Δ 47 2019-09-26, 13:57 New Scala implementation by user [taus] taus
👁 Δ 46 2019-09-26, 13:46 New Csharp implementation by user [dingo] dingo
👁 Δ 45 2019-07-06, 11:24 [Rust] Removed pub erlend.powell
👁 Δ 44 2019-07-06, 11:24 New Rust implementation by user [erlend.powell] erlend.powell
👁 Δ 43 2017-12-21, 03:23 [Clojure] formatting anon20171221
👁 Δ 42 2017-12-21, 03:16 [Clojure] formatting and docs anon20171221
👁 Δ 41 2017-12-21, 03:00 [Clojure] comment/explain-stuff formatting anon20171221
👁 Δ 40 2017-12-21, 02:59 New Clojure implementation by user [anon20171221] anon20171221
👁 Δ 39 2017-06-14, 15:08 New Scheme implementation by user [Dodopod] Dodopod
👁 Δ 38 2017-03-19, 20:58 [Ruby] Alternative impl => new impl 1946. No sample values in code. programming-idioms.org
👁 Δ 37 2017-03-19, 20:56 New Ruby implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 36 2017-03-19, 19:31 [Ruby] one line alternative using tap mooreniemi
👁 Δ 35 2016-11-30, 22:20 [Elixir] Not an "inside code" comment programming-idioms.org
👁 Δ 34 2016-11-30, 22:18 [Elixir] Moved comments. +DemoURL programming-idioms.org
👁 Δ 33 2016-04-07, 06:53 New Lua implementation by user [Nepta]
👁 Δ 32 2016-02-19, 15:33 [PHP] variable name update
👁 Δ 31 2016-02-19, 15:00 [PHP] Updated function name
👁 Δ 30 2016-02-19, 14:58 New PHP implementation by user [AgillaDev]
👁 Δ 29 2016-02-18, 17:22 Restored version 27
👁 Δ 28 2016-02-18, 16:57 [Erlang] Comments format
👁 Δ 27 2016-02-17, 18:00 New Cpp implementation by user [everyday847]
👁 Δ 26 2016-02-17, 17:00 [Ada] Corrected parameter name from N to I
👁 Δ 25 2016-02-17, 16:59 New Ada implementation by user [Smaehtin]
👁 Δ 24 2016-01-27, 11:05 [Erlang] Comments format
👁 Δ 23 2016-01-26, 02:26 [Erlang] Online demo added
👁 Δ 22 2016-01-26, 02:26 New Erlang implementation by user [elbrujohalcon]
👁 Δ 21 2016-01-01, 00:27 New Go implementation by user [lck]
👁 Δ 20 2015-11-30, 12:37
👁 Δ 19 2015-10-29, 14:05
👁 Δ 18 2015-09-09, 09:02
👁 Δ 17 2015-09-09, 09:01
👁 Δ 16 2015-09-05, 19:00
👁 Δ 15 2015-09-04, 16:01
👁 Δ 14 2015-09-04, 15:56
👁 Δ 13 2015-09-04, 15:45
👁 Δ 12 2015-09-04, 15:43
👁 Δ 11 2015-09-04, 13:36
👁 Δ 10 2015-09-03, 17:18
👁 Δ 9 2015-08-23, 10:47
👁 Δ 8 2015-08-22, 21:30
👁 Δ 7 2015-08-20, 10:33
👁 Δ 6 2015-08-19, 17:21
👁 Δ 5 2015-08-01, 17:28
👁 Δ 4 2015-08-01, 17:26
👁 Δ 3 2015-08-01, 17:26
👁 Δ 2 2015-07-31, 19:46
1 2015-05-06, 21:04