mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-01-01 03:12:23 +08:00
Add odd and even functions
This commit is contained in:
parent
4f09d945dd
commit
4afdee1c09
@ -22,6 +22,8 @@ def print(x) { \n\
|
||||
}; \n\
|
||||
def max(a, b) { if (a>b) { a } else { b } } \n\
|
||||
def min(a, b) { if (a<b) { a } else { b } } \n\
|
||||
def odd(x) { if (x % 2 == 1) { true } else { false } } \n\
|
||||
def even(x) { if (x % 2 == 0) { true } else { false } } \n\
|
||||
def for_each(container, func) : call_exists(range, container) { \n\
|
||||
var range = range(container); \n\
|
||||
while (!range.empty()) { \n\
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user