Is there a way to link two branches of code?
In my CYOA, one of the paths starts with the main character finding a green light, if they do they go down the ufo path. If they don't, they go down another path that they could have gone down if they picked a different path at the beginning. So I have two paths that are exactly the same and to achieve this I've been just copying and paste the branch to that branch, but is there a better way to do this? Maybe with functions or something?
The lines I am talking about are 30-47 and 49-62
This is in python, if you can't see the python symbol by the name.
Ok, so I think you are going to have to change how you do things.
def path_1(): print("...") def path_2(): print("...") def path_1_2(): print("...") def path_1_3(): print("...") def main(): print("choose some path") # then you call it: path_2() main()
This way allows you to rechoose paths and go all sorts of ways :D