02 2014 档案
摘要:在c语言中我三目运算符这么写: a?b:c例如:max = a>b?a:b;在lua中我们这么写max = a>b anda or b运行如下:
阅读全文
摘要:and是与运算,返回值如下 如果前者为false或者nil,则返回前者,否则后者A and B类似如下语句if not A thenreturn Aelsereturn Bend总结:and运算只要前者不为false或者nil ,均返回后者运行截图:-------------------------------------------------------or是或运算,返回值如下: 如果前者为真返回前者,否则返回后者A or B相当于以下代码if A thenreturn Aelsereturn Bend总结:or运算,只要前者不是false或者nil,就返回前者。否则返回后者运行截图...
阅读全文