Open justinyaodu opened 3 years ago
I believe the cycle function can be simplified when there are only two elements to toggle between:
cycle
arr=(true false) toggle() { printf '%s ' "${arr[${i:=0}]}" ((i=1-i)) # ((i=i^1)) also works }
What do you think?
I believe the
cycle
function can be simplified when there are only two elements to toggle between:What do you think?