Recursion is a kind of function call in which a function calls itself. Such functions are also called recursive functions. Structural recursion is a method of problem solving where the solution to a problem depends on solutions to smaller instances of the same problem.
Récemment, j'ai rencontré un petit quiz sur le codage d'un sablier en utilisant récursif en java. Voici la partie de codage que j'ai faite. * * * *
* * *
...
J'ai une fonction récursive qui s'appelle elle-même jusqu'à ce qu'elle obtienne la bonne entrée. def input_something(prompt = ""):
playerInput = input(prompt)
...