+ 2
How can i stop this function?
https://code.sololearn.com/WhScSRUmCFdv/?ref=app I already tried to use this: If(n1 == 4 && n2 == 5 && n3 == 6){ break; } but in console shows: illegal break statemant. this code shows all possibilities between 1 and 6 using only 3 numbers, but i need It to stop in 4 5 6. sorry my English is very poor
6 Answers
+ 2
Here is solution from what I think ur trying to do
https://code.sololearn.com/WHLDOl2BkKem/?ref=app
+ 3
"break;" only work for loop. Use "return;" for function instead.
Edit: if you want to stop the execution of the interval and not the function only, use clearInterval() as in YUGABDH's answer
+ 2
There are 20 possibilities, but i cant use combinations like 321 because to my porpose it is the same of 123. have you ever heard about "Megasena"?
in my country we use this formula:
P = t!/(n!*(t-n)!)
where P = possibilities
t = total of numbers
n = numbers i can use
with this formula I find how many combinations i can make
+ 1
It cant repeat the number and i need it in order. I cant use 645 or 436 for exemple
+ 1
thanks for helping me YUGABDH PASHTE
0
Why 111 is not possible combination and some more like this