摘要: 在c语言中我三目运算符这么写: a?b:c例如:max = a>b?a:b;在lua中我们这么写max = a>b anda or b运行如下: 阅读全文
posted @ 2014-02-26 16:48 Please Call me 小强 阅读(730) 评论(0) 推荐(0) 编辑
摘要: 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,就返回前者。否则返回后者运行截图... 阅读全文
posted @ 2014-02-26 16:20 Please Call me 小强 阅读(549) 评论(0) 推荐(0) 编辑