(Recursive) nested loops and IFs?
|
12-17-2015, 07:17 AM
(This post was last modified: 12-17-2015 07:24 AM by chromos.)
Post: #1
|
|||
|
|||
(Recursive) nested loops and IFs?
Hi,
I'm writting solver for incomplete coordinates for multi caches (is there any geocacher out there?) which solves (brute force) inequalities, but their quantity and number of variables (and their names) is obtained from user via INPUT. For six inequalities and four variables I have this static code: (L1...coords via user input, something like {"5","0","3","5","(A+1)","(B)","(B-A-4)","0","1","5","2","4","(C-14)","(D-8)","(C-D+3)"} L2...List of variable names, L3, L4...Lists of variable boundaries, L5...List of expressions L6...valid variable values Digitsum... digit sum of whole coordinates) PHP Code: SUBRFROMTO() I tried to build it recursively, but this is my first encounter with recursion so I can't find syntax which works. I tried it with another approach where I packed everything as text and then I execute it via EXPR(...) and it works. Dissadvantage is unreadable code and everything must be in one string otherwise FOR and END will collapse. Can anybody show me how build nested loops and IFs if I don't know their quantity beforehand? Some screenshots: Prime G2, 15C CE |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(Recursive) nested loops and IFs? - chromos - 12-17-2015 07:17 AM
RE: (Recursive) nested loops and IFs? - chromos - 12-17-2015, 07:28 AM
RE: (Recursive) nested loops and IFs? - Didier Lachieze - 12-17-2015, 11:50 AM
RE: (Recursive) nested loops and IFs? - chromos - 12-17-2015, 12:15 PM
RE: (Recursive) nested loops and IFs? - Didier Lachieze - 12-17-2015, 04:17 PM
RE: (Recursive) nested loops and IFs? - chromos - 12-17-2015, 08:20 PM
RE: (Recursive) nested loops and IFs? - Didier Lachieze - 12-18-2015, 08:06 AM
RE: (Recursive) nested loops and IFs? - chromos - 12-18-2015, 10:25 PM
RE: (Recursive) nested loops and IFs? - Didier Lachieze - 12-18-2015, 10:40 PM
RE: (Recursive) nested loops and IFs? - chromos - 12-18-2015, 11:32 PM
RE: (Recursive) nested loops and IFs? - Didier Lachieze - 12-19-2015, 12:00 AM
RE: (Recursive) nested loops and IFs? - chromos - 12-19-2015, 12:05 AM
RE: (Recursive) nested loops and IFs? - chromos - 01-17-2017, 11:46 AM
|
User(s) browsing this thread: 1 Guest(s)