是否有一个函数,例如每次调用关键字或操作时,它会触发返回或计数以更改为一个值,您可以根据您说“喝一杯”的次数分配输出含义,输出将更改直到- 在下面的情况下 - 它的“都是空的:
if action = "喝一杯"
add 1 to count.drink
count 0 = print("full")
count 1 = print ("3/4 left")
count 2 = print("1/2 left")
count 3 = print ("1/4 left")
count 4 = print("all empty")
行动:喝一杯
count = 1
reaction "3/4 left"
行动:喝一杯
count = 2
reaction "1/2 left"
行动:喝一杯
count = 3
reaction "1/4 left"
行动:喝一杯
count = 4
reaction "all empty"