[QUOTE=CuriousOne;154813]Hello.
I have some code, which, based on value of the X variable (changes from 1 to 30)
Should call some GOSUBs as shown below:
Code:
IF X=1 THEN GOSUB ONE
IF X=2 THEN GOSUB ONE: GOSUB TWO
IF X=3 THEN GOSUB ONE: GOSUB TWO: GOSUB THREE
IF X=4 THEN GOSUB ONE: GOSUB TWO: GOSUB THREE: GOSUB ONE
IF X=5 THEN GOSUB ONE: GOSUB TWO: GOSUB THREE: GOSUB ONE: GOSUB TWO
IF X=6 THEN GOSUB ONE: GOSUB TWO: GOSUB THREE: GOSUB ONE: GOSUB TWO: GOSUB THREE
I am just sitting here with a cup of coffee and wondering if this might work?
Code:
FOR LP = 1 to X/3
[If X//3 = 0 THEN] GOSUB ONE: GOSUB TWO: GOSUB THREE
? NEXT LP
If X//3 = 1 THEN GOSUB ONE
If X//3 = 2 THEN GOSUB ONE: GOSUB TWO
? NEXT LP
Looking again, it may be that I have misread your intent. I think then that a bare loop is not right and you might complete the loop portion before evaluating the remainder. If this is the case, no "IF" is required (The x//3 = 0 conditional]
Sorry that I'm not able to test this. In my mind it was so clear and produced the pattern illustrated with beautiful simplicity. Perhaps it might still be of some use.
Bookmarks