Skip to content

References

TvoozMagnificent edited this page Aug 25, 2022 · 5 revisions

o/v tend to mean, "obvious". For instance, it might be already implemented in python, i.e. checking which string is smaller.

String Representation

int flt str arr set bol
o/v o/v len(...)==1 ? "'"+... : '"'+...+'"' '['+','.join(...)+']' '{'+','.join(...)+'}' ...?'y':'n'

Implied Type Conversion

For strings, refer to the section on String Representation.

from \ to int float array set bool character stack
int o/v o/v range(1,...+1) range(1,...+1) ...!=0 +,-,0 range(1,...+1)
flt o/v o/v range(1,(...//1)+1) range(1,(...//1)+1) ...>0 +,-,0 range(1,(...//1)+1)
str len(...) len(...) list(...) list(...) ...!='' ...[0] list(...)
arr len(...) len(...) o/v o/v ...!=[] '[' o/v
set len(...) len(...) sorted(list(...)) o/v ...!=[] '{' shuffle(...)
bol 0,1 0,1 [] [] o/v y,n []

Comparison

int flt str arr set bol
< o/v o/v o/v one by one, null is smallest subset o/v
= o/v o/v o/v o/v o/v o/v

Built In Functions

Note that this is not valid syntax. All numbers should be variables and calc should be prepended.

addition            2 3 4  =>  2+3+4
subtraction         2 3 4  =>  2-3-4
multiplication      2 3 4  =>  2*3*4
division            2 3 4  =>  2/3/4
modulo              2 3 4  =>  2%3%4   # Which is 2%3
power               2 3 4  =>  2^3^4   # Which is 2^81
less                2 3 4  =>  2<3<4
greater             2 3 4  =>  2>3>4
equal               2 3 4  =>  2=3=4   # Which is 2==3 AND 3==4
pop                [2,3,4] => [  3,4]  # Does NOT modify original list
reverse            [2,3,4] => [4,3,2]
index              [2,3] 1 => [2,3][0] # SunSip is 1-indexed
push               [2,3] 4 => [2,3,4]
join               [2,3] 4 =>  "243"   # Automatically turned into strings
split              "243" 4 =>  [2,3]
range               1 2 10 => [1.0,3.0,5.0,7.0,9.0]
                                       # Automatically turned into floats
type               # turn the first argument to the type of the second argument
verbatimtype       # turn the first argument to the type indicated by the second argument
                   # the second argument should be something like "string"
int                 "-30"  =>   -30
float               "-03"  =>  -3.0
character          # return ascii character for the given code
ordinal            # return code for the given ascii character

sine, cosine, tangent, arcsine, arccosine, arctangent, 
factorial, log, phi, pi, e, union, intersection, difference
                   # self explanatory; log takes value and base

Yo, who needs a custom sidebar?

Not me!

Clone this wiki locally