vector.tostring

Given a vector, self, this function will create a new string out of the vector's components. This can also be written as print(self). If self does not follow Computercraft's vector style (a table with the contents: x, y, and z) the function will error.

ExamplePrint a vector
Prints our vector
Code
<nowiki>
local myVector = vector.new(240, 71, -3040)
print("My new vector has the components:", myVector)
    </nowiki>
Output My new vector has the components: 240 71 -3040

vector.tostring
Function
Syntax
vector.tostring(
  • self : table
)
Colon notation: self:tostring()

Returns string vector
API vector
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.