For questions involving recursive functions, or functions or programs calling itself, directly or indirectly.

learn more… | top users | synonyms

10
votes
1answer
188 views

Recursive Steiner Chains

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images: In ...
46
votes
32answers
4k views

Alex-style Addition

Inspired by Alex's glorious Learn you an R for great good, we are going to humbly recreate Alex's "one true R program" -- but with a twist. Alex-style Addition works like this -- it has a 90% chance ...
26
votes
3answers
595 views

Tiny Lisp, tiny interpreter

Lisp programmers boast that Lisp is a powerful language which can be built up from a very small set of primitive operations. Let's put that idea into practice by golfing an interpreter for a dialect ...
13
votes
7answers
274 views

Prefix Tree Traversal

Write a program that takes in (via stdin or command line) a string with the recursive form PREFIX[SUFFIXES] where PREFIX may be any string of lowercase letters (a-z), including the empty string, ...
26
votes
11answers
1k views

Print, Increment, Decrement, Alias - Interpret Prindeal

Prindeal (pronounced prin-dee-al) is a new esoteric programming language that only has four commands: print, increment, decrement, and alias. Despite its minimalism, complex mathematical operations ...
19
votes
12answers
1k views

Evaluating Parentheses and Brackets as Integers

Write a program that takes in a string of the four characters ()[] that satisfies these points: Every left parenthesis ( has a matching right parenthesis ). Every left bracket [ has a matching right ...
7
votes
8answers
1k views

Ways to arrange the integers 1 to 9 with operators so that the result is 100

Prelude: This task is taken from Five Problems Every Software Engineer Should Be Able to Solve in Less Than an Hour, which I really recommend. The task: Write a program that outputs all ...
5
votes
2answers
770 views

Coding a recursive function for highest possible input

Challenge You are given the following function:- which is the same as:- with the base cases q(r, b, L) = 1 whenever r ≤ L, q(r, 0, L) = 0, if r > L and q(r, 0, L) = 1, if r ≤ L. Your task is to ...
20
votes
26answers
5k views

The Ackermann function

The Ackermann function is notable for being the one of the simplest examples of a total, computable function that isn't primitive recursive. We will use the definition of A(m,n) taking in two ...