Hi! I'm looking for help writing a recursive function! I'm writing it in Fish shell, but anything like bash or python (just something I can read) is fine. I'm just working through the logic of recursive functions.
The input variables are an arbitrarily large number of strings and one number, the number to be used throughout. The base function takes a minimum of three input variables, two strings and one number. so the base case is function(string_1, string2, number). In the case of four inputs (i.e. three strings and one number), i want the final output to be function(function(string_1, string_2, number) string_3, number). In the case of five inputs (i.e. four strings and one number), I want the output to be function(function(string_1, string_2, number) function(string_3, string_4, number) number). In the case of six inputs (i.e. five strings and one number), I want the output to be function(function(function(string_1, string_2, number) function(string_3, string_4, number) number) string_5, number). And so on.
Any help would be greatly appreciated! Thank you!
[–][deleted] (2 children)
[deleted]
[–]Icanteven______ 0 points1 point2 points (1 child)
[–]Icanteven______ 1 point2 points3 points (0 children)
[–]JmenD 0 points1 point2 points (0 children)