Hello! Is there a way to make this: if a == 1 && b == 1 && c == 1 && d == 1:
become something* like this: if a&&b&&c&&d == 1:
*but not grouping them in strings, arrays or anything.
Imagine I have 50 of these (a, b, c, etc) and I need to check them for different combinations, example: if a && b && g && h && m && x && z == 1:
and then another one like: if c && h && t && o && p && q == 1: … etc
I was asking so I could save some time coding because there are a lot of combinations to be done and I need specific combinations, because it’s about puzzles.
I think I’ll settle for if a == 1 && b == 1 && c == 1 && d == 1
I don’t know if I am getting this right but you need things to match? I have a scratch project with this way of matching a password input by a player.
func pw_text_submitted(_new_text):
## makes player enter their username and then use the password they set.
if pw1.text && pw2.text == pw1.text:
MyGlobals.player_pw = pw2.text
MyGlobals.player_name = username.text
SaveGameGlobals.save_game()
get_tree().change_scene_to_file("res://Desktop/boot_user_input.tscn")
print("YAAAA, it's a macth")
else:
pw_wrong.visible = true
print("BOO, make sure it matches")