foreach is impossible in this case
Thinking about the if condition to do the loop
- Define tmpInt = 0, tmpMax = 10 and tmpIntList
- Assign tmpInt = tmpInt + 1
- If tmpInt <= tmpMax, then ListAppend tmpInt to tmpIntList => back to step 2
- Else end
By this approach, u can change easily change the tmpMax to any number that u wanna end the list