If you want to set a value of string to a variable, enclose them in quotations.
On line 176, you are doing [rank = apprentice, '']^[age == 6] however, apprentice as a variable doesn’t exist. Which is why rank returns undefined when the age is 7. I would assume that it should be a string [rank = "apprentice", '']^[age == 6].
Then on debugging (Line 178), it should also be using strings e.g. [rank == "kit"]^[age <= 6][rank == "apprentice"]^[6 < age && age <=12]
check_for_uprank[""]^0.000001//Not foolproof, but just testing.[rank = apprentice, ""]^[age=="6"]
You are setting the rank variable to an undefined value apprentice. But on the debug_error_1, you are setting the value to "apprentice" when age is 6.
Then if the age increased to greater than 7, the debug_error_1 would default to the first item since both items doesn’t have odds. Which makes it that after 7, the rank would be kit again.
Lastly, on events_decider you are again comparing a variable to another variable, where it should be a variable and an absolute value like ^[rank == "kit"] not ^[rank == kit]
If you want to set a value of string to a variable, enclose them in quotations.
On line 176, you are doing
[rank = apprentice, '']^[age == 6]
however,apprentice
as a variable doesn’t exist. Which is why rank returns undefined when the age is 7. I would assume that it should be a string[rank = "apprentice", '']^[age == 6]
.Then on debugging (Line 178), it should also be using strings e.g.
[rank == "kit"]^[age <= 6]
[rank == "apprentice"]^[6 < age && age <=12]
Thanks, but now it isn’t updating at all.
Again on :
check_for_uprank [""]^0.000001 //Not foolproof, but just testing. [rank = apprentice, ""]^[age=="6"]
You are setting the
rank
variable to an undefined valueapprentice
. But on thedebug_error_1
, you are setting the value to"apprentice"
when age is6
.Then if the age increased to greater than 7, the
debug_error_1
would default to the first item since both items doesn’t have odds. Which makes it that after 7, the rank would bekit
again.Lastly, on
events_decider
you are again comparing a variable to another variable, where it should be a variable and an absolute value like^[rank == "kit"]
not^[rank == kit]
The changes should be:
check_for_uprank [rank = "kit", ""] ^[age < 6] [rank = "apprentice", ""]^[age=="6"] events_decider [check_for_uprank][kit_events_decider]^[rank == "kit"]