Hi this is a beginner programming question but I am trying to run a function on a list of variables repeatedly until I request that it stop. i.e.
list = [A,B,C]
I was wondering if there was a better way to do it than the clunky solution I came up with.
list = [ A, B, C]
cont = Ref(true)
k = 1
@async while cont
if k <3
elif k == 3
is this the correct way to approach this in Julia? is there a better way to start the loop over again without having to go through a test for conditions? Any corrections/ insights would be appreciated thanks!
Wow! thanks to everyone for the amazing suggestions. Modulo works great. What exactly is Julia doing in the line cont || break in @digital_carver’s code? Is there somewhere I can find out more about that? Is that a shorthand form of an if, elif statement?