Advertisement
Rochet2

1/0 is not true/false or bool. Only true since it exists

Mar 29th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. --[[1/0 is not true/false or bool. Only true since it exists]]
  2. -- This code illustrates the point that
  3. -- 1/0 does not mean true/false in every situation.
  4. local a = 0
  5. if(a)then
  6. print(1)
  7. end
  8. if(1)then
  9. print(2)
  10. end
  11. if(0)then
  12. print(3)
  13. end
  14. if(true)then
  15. print(4)
  16. end
  17. if(false)then
  18. print(5) -- wont print
  19. end
  20.  
  21. print("Let me guess. 5 did not print?")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement