mirror of
https://github.com/Reuh/language-candran.git
synced 2025-10-27 12:19:30 +00:00
Added math functions snippets
Added math functions snippets also fixed some Readme errors
This commit is contained in:
parent
91958e3bd2
commit
bb0f007168
2 changed files with 133 additions and 5 deletions
41
README.md
41
README.md
|
|
@ -20,8 +20,8 @@ Common snippets
|
|||
| ifne | if not else conditional | if not value then --body... else --body... end |
|
||||
| loc | local variable definition shortcut | local x = 1 |
|
||||
| local | local variable definition | local x = 1 |
|
||||
| log | log | print("logging") |
|
||||
| ltab | local table definition | local name = {} |
|
||||
| print | print | print("logging") |
|
||||
| rep | repeat loop shortcut | repeat -- body... until condition |
|
||||
| repeat | repeat loop | repeat -- body... until condition |
|
||||
| req | require shortcut | local name = require "module" |
|
||||
|
|
@ -30,9 +30,9 @@ Common snippets
|
|||
| return | return definition | return value |
|
||||
| tab | table definition | name = {} |
|
||||
| whi | while loop shortcut | while condition do -- body... end |
|
||||
| while | while loop shortcut | while condition do -- body... end |
|
||||
| while | while loop | while condition do -- body... end |
|
||||
|
||||
Table function snippets
|
||||
Table manipulation snippets
|
||||
---
|
||||
| Trigger | Name | Body |
|
||||
| ------------- |--------------------------| ---------------------|
|
||||
|
|
@ -40,7 +40,42 @@ Table function snippets
|
|||
| tabf | table.foreach | table.foreach(tableName, function) |
|
||||
| tabi | table.insert | table.insert(tableName, data) |
|
||||
| tabs | table.sort | table.sort(tableName, sortfunction) |
|
||||
| tabr | table.remove | table.remove(tableName, position) |
|
||||
| tabm | table.maxn | table.maxn(tableName)
|
||||
|
||||
Math function snippets
|
||||
---
|
||||
| Trigger | Name | Body |
|
||||
| ------------- |--------------------------| ---------------------|
|
||||
| abs | math.abs | math.abs(x) |
|
||||
| acos | math.acos | math.acos(x) |
|
||||
| asin | math.asin | math.asin(x) |
|
||||
| atan | math.atan | math.atan(x) |
|
||||
| atan2 | math.atan2 | math.atan2(y, x) |
|
||||
| ceil | math.ceil | math.ceil(x) |
|
||||
| cos | math.cos | math.cos(x) |
|
||||
| cosh | math.cosh | math.cosh(x) |
|
||||
| deg | math.deg | math.deg(x) |
|
||||
| exp | math.exp | math.exp(x) |
|
||||
| floor | math.floor | math.floor(x) |
|
||||
| fmod | math.fmod | math.fmod(x, y) |
|
||||
| frexp | math.frexp | math.frexp(x) |
|
||||
| huge | math.huge | math.huge |
|
||||
| ldexp | math.ldexp | math.ldexp(m, e) |
|
||||
| log | math.log | math.log(x) |
|
||||
| log10 | math.log10 | math.log10(x) |
|
||||
| max | math.max | math.max(x, ...) |
|
||||
| min | math.min | math.min(x, ...) |
|
||||
| pi | math.pi | math.pi |
|
||||
| pow | math.pow | math.pow(x, y) |
|
||||
| rad | math.rad | math.rad(x) |
|
||||
| random | math.random | math.random(m, n) |
|
||||
| randomseed | math.randomseed | math.randomseed(x) |
|
||||
| sin | math.sin | math.sin(x) |
|
||||
| sinh | math.sinh | math.sinh(x) |
|
||||
| sqrt | math.sqrt | math.sqrt(x) |
|
||||
| tan | math.tan | math.tan(x) |
|
||||
| tanh | math.tanh | math.tanh(x) |
|
||||
|
||||
Author
|
||||
------
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@
|
|||
'return definition shortcut':
|
||||
'prefix': 'ret'
|
||||
'body': 'return ${0:value}'
|
||||
'log':
|
||||
'prefix': 'log'
|
||||
'print':
|
||||
'prefix': 'print'
|
||||
'body': 'print("${0:logging}")'
|
||||
'require':
|
||||
'prefix': 'require'
|
||||
|
|
@ -83,3 +83,96 @@
|
|||
'table.sort':
|
||||
'prefix': 'tabs',
|
||||
'body': 'table.sort(${1:tableName}${2:, sortfunction})'
|
||||
'table.remove':
|
||||
'prefix': 'tabr',
|
||||
'body': 'table.remove(${1:tableName}${2:, position})'
|
||||
'table.maxn':
|
||||
'prefix': 'tabm',
|
||||
'body': 'table.maxn(${1:tableName})'
|
||||
'math.abs':
|
||||
'prefix': 'abs',
|
||||
'body': 'math.abs(${0:x})'
|
||||
'math.acos':
|
||||
'prefix': 'acos',
|
||||
'body': 'math.acos(${0:x})'
|
||||
'math.asin':
|
||||
'prefix': 'asin',
|
||||
'body': 'math.asin(${0:x})'
|
||||
'math.atan':
|
||||
'prefix': 'atan',
|
||||
'body': 'math.atan(${0:x})'
|
||||
'math.atan2':
|
||||
'prefix': 'atan2',
|
||||
'body': 'math.atan2(${0:y}, ${1:x})'
|
||||
'math.ceil':
|
||||
'prefix': 'ceil',
|
||||
'body': 'math.ceil(${0:x})'
|
||||
'math.cos':
|
||||
'prefix': 'cos',
|
||||
'body': 'math.cos(${0:x})'
|
||||
'math.cosh':
|
||||
'prefix': 'cosh',
|
||||
'body': 'math.cosh(${0:x})'
|
||||
'math.deg':
|
||||
'prefix': 'deg',
|
||||
'body': 'math.deg(${0:x})'
|
||||
'math.exp':
|
||||
'prefix': 'exp',
|
||||
'body': 'math.exp(${0:x})'
|
||||
'math.floor':
|
||||
'prefix': 'floor',
|
||||
'body': 'math.floor(${0:x})'
|
||||
'math.fmod':
|
||||
'prefix': 'fmod',
|
||||
'body': 'math.fmod(${0:x}, ${1:y})'
|
||||
'math.frexp':
|
||||
'prefix': 'frexp',
|
||||
'body': 'math.frexp(${0:x})'
|
||||
'math.huge':
|
||||
'prefix': 'huge',
|
||||
'body': 'math.huge'
|
||||
'math.ldexp':
|
||||
'prefix': 'ldexp',
|
||||
'body': 'math.ldexp(${0:m}, ${1:e})'
|
||||
'math.log':
|
||||
'prefix': 'log',
|
||||
'body': 'math.log(${0:x})'
|
||||
'math.log10':
|
||||
'prefix': 'log10',
|
||||
'body': 'math.log10(${0:x})'
|
||||
'math.max':
|
||||
'prefix': 'max',
|
||||
'body': 'math.max(${0:x}, ${1:...})'
|
||||
'math.min':
|
||||
'prefix': 'min',
|
||||
'body': 'math.min(${0:x}, ${1:...})'
|
||||
'math.pi':
|
||||
'prefix': 'pi',
|
||||
'body': 'math.pi'
|
||||
'math.pow':
|
||||
'prefix': 'pow',
|
||||
'body': 'math.pow(${0:x}, ${1:y})'
|
||||
'math.rad':
|
||||
'prefix': 'rad',
|
||||
'body': 'math.rad(${0:x})'
|
||||
'math.random':
|
||||
'prefix': 'random',
|
||||
'body': 'math.random(${0:m}, ${1:n})'
|
||||
'math.randomseed':
|
||||
'prefix': 'randomseed',
|
||||
'body': 'math.randomseed(${0:x})'
|
||||
'math.sin':
|
||||
'prefix': 'sin',
|
||||
'body': 'math.sin(${0:x})'
|
||||
'math.sinh':
|
||||
'prefix': 'sinh',
|
||||
'body': 'math.sinh(${0:x})'
|
||||
'math.sqrt':
|
||||
'prefix': 'sqrt',
|
||||
'body': 'math.sqrt(${0:x})'
|
||||
'math.tan':
|
||||
'prefix': 'tan',
|
||||
'body': 'math.tan(${0:x})'
|
||||
'math.tanh':
|
||||
'prefix': 'tanh',
|
||||
'body': 'math.tanh(${0:x})'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue