leekscript-next
leekscript-next copied to clipboard
A dynamically typed, compiled just-in-time programming language used in Leek Wars' AIs
Possible on every collection, constructs a map with elements as keys and number of occurrences as values. ```js [1, 1, 2, 3, 3].frenquencies() // [1: 2, 2: 1, 3: 2]...
Instead of: ```js var result = getFromComplexFunction(arguments) if (result) { return result } ``` new syntax: ```js return? getFromComplexFunction(arguments) ```
``` array.flatten() ==> array array.flatten() ==> array array.flatten(1) ==> array array.flatten(2) ==> array ```
- [ ] array.empty, string.empty etc. - [ ] array.full, string.full etc. - [ ] bool.true, bool.false - [ ] number.zero, number.positive, number.negative
```js var a = [1, 2, 3] for (var x in a) { // automatic mode for (var +x in a) { // copy mode for (var @x in a)...