Not understanding something about "while"... #215
Replies: 1 comment
-
Ok, made it work with a different approach: [sets whilebreakerfakemale=0] But for reasons I don't understand I need to do those if separated, as if I write instead in a last line then it never seems to get inside the if, like if the condition was never true... I'm no programmer so maybe I'm wrong, but as far as I understand _any should relate them as "or" which should be pretty much the same of having those ifs separated as I have them right now. Since I'm not sure wether it is a bug or a mistake at my end I'm not reporting it as a proper bug. |
Beta Was this translation helpful? Give feedback.
-
Ok, so this is my code, the idea is to have a prompt particle constructed where var1, var2 and var3 are none of them equal to each other:
[set fakegirl1][call masterprompt-sdxl/gender/xgenderfamefemale][/set]
[set fakegirl2][call masterprompt-sdxl/gender/xgenderfamefemale][/set]
[set fakegirl3][call masterprompt-sdxl/gender/xgenderfamefemale][/set]
[while "fakegirl1 is {get fakegirl2} or fakegirl1 is {get fakegirl3} or fakegirl2 is {get fakegirl3}"]
[set fakegirl1][call masterprompt-sdxl/gender/xgenderfamefemale][/set]
[set fakegirl2][call masterprompt-sdxl/gender/xgenderfamefemale][/set]
[set fakegirl3][call masterprompt-sdxl/gender/xgenderfamefemale][/set][/while]
`[[get fakegirl1]|[get fakegirl2]|[get fakegirl1]|[get fakegirl2]|[get fakegirl3]]
However it ends up in an infinite loop as soon as one of them happens to be equal to another one of them. I've tried removing {} but then there's no infinite loop but they can get equal to one another (as I suspect it then checks if fakegirl1=="fakegirl2" as a string value...
I really don't get what's wrong with my code, as far as I understand the variables should get updated every cycle of the loop and eventually happen to be all 3 of them different... (the list is of over 50 names, so it should happen quite easily)
Beta Was this translation helpful? Give feedback.
All reactions