Simplex is Turing Complete's custom language. It is used in the levels test.si files for validating solutions.
Helpful tools[edit | edit source]
Built-in functions[edit | edit source]
This list is incomplete, and some of the function signatures are guesses.
Arithmetic Operations[edit | edit source]
log10(x: AnyInt) Intlog10(number: U64) Intulog2(x: AnyUInt) Intlog2(x: AnySInt) Intasr(x: AnyInt, shift_amount: AnyInt) Intpopcount(x: AnyInt) Inttrailing_zeros(x: AnyInt) Int
Arrays[edit | edit source]
array(element: @Type, length: Int) [@Type]type_of_element(array: [@Element]) Type- Returns the type of the elements in the array.
quick_sort($arr: [@Any])sort($arr: [@Any])
Display[edit | edit source]
hex(num: @Size) Stringoutput(text: String)print(x: @Any)- Prints
xto the console.
- Prints
str(x: @Type) String- Returns a string representation of
x.
- Returns a string representation of
Dot functions[edit | edit source]
these use the dot operator, for example
let arr = [U64 0, 0, 0]
print( arr.len() ) // Prints 3
high(a: [@Any]) Intin(value: @Type, array: [@Type]) Boollen(array: [@Any]) Int
Memory[edit | edit source]
memory_clear(source: Ptr, length: Int)memory_commit(pointer: Ptr, length: Int)memory_copy(source: Ptr, destination: Ptr, length: Int)memory_copy_reverse(source: Ptr, destination: Ptr, length: Int)memory_free(pointer: Ptr, size: Int)memory_reserve(length: Int) Ptr
Random[edit | edit source]
random() Intrandom(max: Int) Intrandom(type: @Type) @Typerandomize_seed(...?)sample(array: [@Any]) @Any
Utility[edit | edit source]
assert(condition: Bool, error_code: Int)int_of_size(value: Int, size: Int): @Sxx- Returns a signed integer of width size with value, all parameters must be resolved at compile time.
e.g. int_of_size(4, 32) is the same as S32 4
sleep(duration: Time)

