Skip to content

Subfunction Types

Linus Klöckner edited this page Apr 26, 2020 · 2 revisions

Every Subfunction has an input string (the signature). Some may also have an argument (integer).

Reverse:

Reverses the signature

js:

signature.reverse()

c++:

std::reverse(signature->begin(), signature->end())

Splice:

Removes a part of the signature (beginning to arguments position)

js:

signature.splice(0, argument)

c++:

signature->erase(0, argument)

Swap:

Swaps two chars of the signature (first char with char at arguments position)

js:

var c=signature[0]; 
signature[0]=signature[argument%signature.length]; 
signature[argument%signature.length]=c;

c++:

char c = signature[0];
signature[0] = signature[argument % signature->length()];
signature[argument] = c;