D Doug Flagg New Member Licensed User Mar 26, 2019 #1 I'm trying to port this c# function to b4a. I'm having a problem with the highlighted line, any suggestions? private void combinationUtil(int[] arr, int[] data, int start, int end, int index, int r) { if (index == r) { string a = ""; for (int j = 0; j < r; j++) if (data[j] < 10) a += "0" + Convert.ToString(data[j]) + " "; else a += Convert.ToString(data[j]) + " "; combos.Add(a); return; } for (int i = start; i <= end && end - i + 1 >= r - index; i++) { data[index] = arr; combinationUtil(arr, data, i + 1, end, index + 1, r); } } Last edited: Mar 26, 2019
I'm trying to port this c# function to b4a. I'm having a problem with the highlighted line, any suggestions? private void combinationUtil(int[] arr, int[] data, int start, int end, int index, int r) { if (index == r) { string a = ""; for (int j = 0; j < r; j++) if (data[j] < 10) a += "0" + Convert.ToString(data[j]) + " "; else a += Convert.ToString(data[j]) + " "; combos.Add(a); return; } for (int i = start; i <= end && end - i + 1 >= r - index; i++) { data[index] = arr; combinationUtil(arr, data, i + 1, end, index + 1, r); } }
Erel B4X founder Staff member Licensed User Longtime User Mar 26, 2019 #2 Code: Dim i As Int = Start Do While i <= vEnd AND vEnd - i + 1 >= r - index 'code here i = i + 1 Loop Upvote 0
Code: Dim i As Int = Start Do While i <= vEnd AND vEnd - i + 1 >= r - index 'code here i = i + 1 Loop