document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. local myvar = 3; //  a local variable
  2.  
  3. a = b = c = 3
  4.  
  5. put("a = "+a+", b = "+b+" and c = "+c+"\\n")
  6. // gives: a = 3, b = 3 and c = 3
  7.  
  8. var1 = 1
  9. puts(type(var1)) // prints integer
  10.  
  11. var2 = "hello!"
  12. puts(type(var2)) // prints string
  13.  
  14. var3 = 3.14
  15. puts(type(var3)) // prints float
  16.  
  17. var4 = []
  18. puts(type(var4)) // prints table
  19.  
  20. /*
  21.    the difference between put and puts is that
  22.    puts adds automatically a line jump is the end of the string,
  23.    which means puts(a) = put(a+"\\n")
  24. */
  25.  
  26. // Tables:
  27. iTable = []
  28. iTable[0] = 3
  29. iTable[1] = 3.14
  30. iTable[2] = "3.14"
  31.  
  32. meTable = [1, "hi", 14.3, [1, 2, 3]]
  33. put(meTable[3][1]) // prints  ^
  34.  
  35. // Tables as records:
  36. Player = []
  37. Player["name"] = "XerXeS"
  38. put(Player.name) // prints XerXeS
  39.  
  40. /*
  41.    table["id"] is the same as table.id
  42.    however, the id in the second form, shall be an identifier, not a number.
  43. */
');