mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-10-23 13:30:05 +00:00
Updated examples and README to use proper syntax
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Cosmo
|
||||
Cosmo is a portable scripting language loosely based off of Lua. Cosmo easily allows the user to extend the language through the use of Proto objects, which describe the behavior of Objects. For example the following is a simple Vector Proto which describes behavior for a Vector-like object.
|
||||
|
||||
```
|
||||
```lua
|
||||
proto Vector
|
||||
function __init(self)
|
||||
self.vector = []
|
||||
@@ -24,11 +24,11 @@ end
|
||||
var vector = Vector()
|
||||
|
||||
for (var i = 0; i < 4; i++) do
|
||||
vector.push(i)
|
||||
vector:push(i)
|
||||
end
|
||||
|
||||
for (var i = 0; i < 4; i++) do
|
||||
print(vector.pop() .. " : " .. vector[i])
|
||||
print(vector:pop() .. " : " .. vector[i])
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user