2. Commands
This is an index of the commands.
(One can form a two-byte command by prefixing an instruction with a tilde (~).)
\b(hex 08) - prevents auto output.\t(hex 09) - takes two argumentsx,y; ifxis defined, return x; otherwise, returny.\x0B(hex 0B) - transpiles to....\x10(hex 10) - joins string by nothing.\x11(hex 11) - returns:array:array.join("").split("").string:string.split("").join(""). (Perhaps useless).number: the number sorted.\f(hex 12) - returns the min of two arguments.\r(hex 13) - returns the max of two arguments.- takes the next characterCand another argumentAand executesA[C]as a function.!-math.js extension."- begins string literal; writes characters to compiled code (surrounded by quotes) until another unescaped"is met. If a'is met, close the previous string and begin a new string.%acts as string interpolation, as such:"Hello, %!"5 => "Hello, 5!"#- convertsato hexadecimal.$- begin function literal; writes characters to compiled code as is, until another unescaped$is met%- takes argumentsaandb, andstring, character- removes all instances ofbfroma.array, anything- removes all instances ofbfroma.number, number-a % b.&- takes the boolean conjunction of two arguments (a && b).'- captures next character as a string.(- “(terminates the program and kills your computer”)- transpiles to){(closes control structure).*- multiplies 2 argumentsnumber, number- multiplies the two numbersstring, number(&) - repeatsstringnumbertimesarray, number- creates a 2D array of lengthnumberthat containsarrayas all of its members+- adds 2 arguments, according to their types:number, number- adds the two numbersanything, stringorstring, anything- returnsstringconcatted withanything(preserving order)array, array- concats the two arraysnon array, array- Putsnon arrayat the beginning ofarrayarray, non array- pushesnon arraytoarrayset, set- the set union of the two sets,- misc. object:,a- draws a box, givenwidth,height, andoptions, in a string,abcd, whereais the corner,bis the horizontal strut,cis the vertical strut, anddis the fill character.,b- given an array, returns an array[min,Q1,med,Q3,max].,B- draws a box plot, given an array with,b.,d- gives the bounding box of the stringa.,r- performs rot13 on stringa.,R- performs reverse rot13 on stringa.,s- performs rotNon stringa.,S- performs reverse rotNon stringa.-- subtracts 2 arguments, according to their types:number, number- subtraction.string, array- removes all objects inarrayfromstring.string, non-array- converts the latter to a string and replaces all isntances of it instringwith nothing, i.e. deletion.array, anything- filters all instances ofanythingout ofarray.number, number- subtraction.- takes 2 argumentsOandpand returnsO[p]; ifO[p]is undefined, returnswindow[O][p]; if that is undefined, returns 42./- takes 2 argumentsAandB:string, anything- deletesanythinginstring.array, array- set difference.array, number- I really have no idea what I wrote.number, number- division- digits
0-9- that number. :- begin character literal; writes the next character to compiled code as is. (NOTE: WILL BE CHANGED!!);- increases arity of current function by one.<- takes 2 argumentsAandBand returnsA < B(JS behaviour).=- takes 2 argumentsAandBand returnsA == B.>- takes 2 argumentsAandBand returnsA > B(JS behaviour).?- ternary if, consumes 3 argumentsc,a, andb. Roughly equivalent toc?a:b. (Warning: evaluatesaandb. Be wary with use in recursive functions. To be fixed, soon.)@- returns the character code of the next character in the source code.A- takes 3 argumentsr,s, andt; replaces each character insfound inrwith the respective character found int.B- takes 1 argumentNand converts it to binary as a string (equiv.(N).toString(2)).C- takes 2 argumentsAandBand parses the stringAas an integer in baseB(equiv.parseInt(A,B)).D- begins a function declaration, beginning withfunction(H,S,n){.E- the empty string""; is a variable.F- returns the "first" property of 1 argument. Literally equivalent toa[0].G- split'sabyb.H- variable used in functions. Undefined to begin with.I- takes input from input box, interpeted as a string.J- takes input from input box, interpeted as a number.K- comma-seperated array input.L- RegExp expansion:- (to be explained)
M- increases arity of current function by 2N- transiples toreturn.O- takes the product of 1 argument, depending on its type:array- takes the product of the array.number- takes digit product of the number.P- takes 1 argumentAand returnsNumber(A)(converts all to number, if possible) (conversion an array into a number, as in[1,2,3,1,0,2] => 123102).Q- squares 1 argumentS, according to its type:number- multiplies it by itselfarray- takes the length of the arrayNand returns an array containingNcopies of itselfstring- appends string with itself (abc => abcabc).R- join'sabyb.S- typically an argument to a predicate or function; initialized to a newline.T- takes 2 argumentsFands; surroundsFexpression (after compilation) with quotes and evaluates that actionFeverysmilliseconds.=U- takes the square root of the argument.V- takes 1 argumentSand is the valueVofS; ifSis a number, returnsS's parity.W-While loop. Potentially buggy when nested.X- JS eval something from input.Y- the empty array[]; is a variable.Z- array expansion:- (tba)
[- begins array literal, with entries seperated by commas\- skips a character, sometimes.]- ends array literal.^- takes 2 argumentsAandBand retursnA^B(exponentiation) (behaviour TBA)_- negates 1 argument, according to its type:stringorarrayorset- reverses the entitynumber- negates the entity`- forces an argument checka- outputs (alerts/writes) 1 argumentb- takes an integerNand a baseband returns(N).toString(b); whenb = 1, this is equal to a string of lengthNfilled with#s (TBR).c- parsesaas an integer in baseb.d- a predicate; roughly analogous to(H,S,n)=>....e- takes 1 argumentSand evaluates it as a new Jolf program.f- date expansion:- er
g- returns the "last" property of 1 argument. Literally equivalent toa[a.length-1].h-heads argumenta. (a+1)i- takes input from input box, interpeted as a string.j- takes input from input box, interpeted as a number.k- comma-seperated array input.l- length ofa.m- math expansion:- (tba)
n- variable, often used in predicates and functions; initialized to0.o- takes next character and literally adds to the source codechar=. Used for setting values.p- takes 3 argumentsa,b, andsand creates a range[a,b)with a steps.q- the programs source code. (Buggy with"and newlines.)r- takes 2 argumentsaandband creates a range[a,b)(inclusive ofaand exclusive ofb)s-r, but with inclusive bounds.t- value of ten. Non-writable.u- takes 1 argumentarrayorset- returns the sum of the entitystring- behaviour TBAnumber- takes the digit sum of the number (e.g.u(140) = 1 + 4 + 0 = 5)v- takes 2 argumentsSandV; sets the value of variableStoVand createsSif nonexistant (returnsV)w- decrements followingargument. (a-1)x- JS eval something from input.y- canvas expansion:- (wait)
z- takes 1 argument and returns a range[1,a].{- begins golfy array. Closed by#(!)|- ORs two arguments.}- closes while (literally,{).]- slice~- more misc expansion:~#- transpiles to()(to be deprecated).~0- Infinity (literally0/1)~1-100.~2-1000.~3-10000.~4-100000.~5-16.~L- levenshtein distance between two strings.~N- writesNumberto the compiled code (to be deprecated).~S- writesStringto the compiled code (to be deprecated).~T- gets the hexadecimal of the charcode of the argument's first char.~P- ϕ,(1+sqrt[5])/2.~a- writesArrayto the compiled code (to be deprecated).~e- Euler's number approx2.718281828459045.~i- takes 1 argument and returns that argument (the identity function).~l- creates a newLevenstheinobject.~o- writesprototypeto the compiled code (to be deprecated).~p- π approx3.141592.~s- writesSetto the compiled code (to be deprecated).~w- writeswindowto the compiled code (to be deprecated).~!- boolean negation.\x7F(hex 7F) - boolean negation.ς- clears the output (lowercase ending sigma).θ- increases the arity of the current function by three.η- decreases the arity of the current function by one.Ʀ- does something.λ- takes the next "function" and uses it as an argument.¶,ᗰ,ᕓ,ᐻ,ᔛ,ᖒ,ራ, andᒺall do stuff too.ν- isnull(lowercase nu).Χ- pops one value off ofa(uppercase Chi).χ- shifts one value off ofa(lowercase chi).Α- checks ifais not a valid Jolf command (uppercase Alpha).φ-d, but with two arguments. (lowercase phi).Ψ- literally(H,S,n)=>. (uppercase Psi).Ω- "super quote";Ω+34would be the string whatever+34transpiles to (not necessarily what you see in the code preview).Ρ- equiv.a.replace(/b/,c)i.e. single replace. (uppercase Rho).ρ- equiv.a.replace(/b/g,c)i.e. global replcae. (lowercase rho).μ- unique-ify input. (lowercase mu).σ- sigma_k(n) function. (lowercase simga).ε- JS eval (lowercase epsilon).ι- provides the index of the token (hardcoded into the resulting code)β- lambda generator©- lambda math΅- lambda stringΞ- decompressions entity\x82- binary manhattan addition (e.g. 1 +m 5 = 15)\x83- ternary manhattan addition (e.g. 3 +m 5 +m 2 = 352)Τ- ternary multiplicationΆ- ternary addition΄- ternary subtractionΟ- ternary division