VTS

From Esolang
Jump to navigation Jump to search

VTS Programming Language

VTS is a modification of python. It also makes code harder to read.

Command Set
VTS Python Description
n >> x x=n Assignment
n *> x x=x*n Multiplication assignment
n /> x x=x/n Division assignment
n !> x x=1;for _ in range(1,n+1): x=x*_ Factorial assignment
n ^> x x=x**n Exponentiation assignment
n -> x x=x-n Subtraction assignment
n +> x x=x+n Addition assignment
n %> x x=x%n Modulo assignment
x ~> y x=round(y) Rounding assignment
x << n n==x Equality comparison
x < n x<n Less than comparison
x <= n x<=n Less than or equal comparison
x >= n x>=n Greater than or equal comparison
?condition:after if condition then after Conditional execution
$i >> x x=input() Input
$i >#x y y=input(x) Prompted input
x >> $o print(x) Output
x >> *y x=str(y) String conversion
x >> @y x=int(y) Integer conversion
n ^ x X = X XOR N Bitwise XOR
x X = X OR N Bitwise OR
n ? x X = X NOT N Bitwise NOT
n & x X = X AND N Bitwise AND
n ?^ x X = X NXOR N Bitwise XNOR
x X = X NOR N Bitwise NOR
n ?& x X = X NAND N Bitwise NAND
n #> [entiry1, entiry2, ...] n=[entiry1, entiry2, ...] List creation
n>>array array.append(n) List append
`array array.clear() List clear
x@array x = array.pop() List pop
x/array x = array.count() List count
n/x@array x = array.count(n) List count specific element
x%array[func, param1, ...] x = array.func(param1, ...) List method call
%$x[func, param1, ...] x = func(param1, ...) Function call with assignment
%x[func, param1, ...] func(param1, ...) Function call
x *# y x = RLEDecode(y) Run-length decoding
x @> y x = Ord(y) Character to ordinal
( VTS Direct literal start
) VTS Direct literal end
x *% y x = Base64Decode(y) Base64 decoding
x *$ y x = Base64Encode(y) Base64 encoding
$o Output reserved variable
$i Input reserved variable
module>>$l import module Module import
kw>>$k kw (keyword) Keyword assignment

Code Examples

(Hello World Program)

"Hello, World!" >> $o

(Print 0..9)

0 >> i
?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o; i+1>>i; ?i<10:i>>$o

(Print input)

$i >> x
x >> $o

(Print primes 1..100)

2 >> p
?p<=100:
    1 >> is_prime
    2 >> d
    ?d<p:
        ?p%d<<0: 0 >> is_prime
        d+1 >> d
        ?d<p:
            ?p%d<<0: 0 >> is_prime
            d+1 >> d
            ?d<p:
                ?p%d<<0: 0 >> is_prime
                d+1 >> d
                ?d<p: ?p%d<<0: 0 >> is_prime
    ?is_prime<<1: p >> $o
    p+1 >> p
    ?p<=100:
        1 >> is_prime
        2 >> d
        ?d<p:
            ?p%d<<0: 0 >> is_prime
            d+1 >> d
            ?d<p:
                ?p%d<<0: 0 >> is_prime
                d+1 >> d
                ?d<p:
                    ?p%d<<0: 0 >> is_prime
                    d+1 >> d
                    ?d<p: ?p%d<<0: 0 >> is_prime
        ?is_prime<<1: p >> $o
        p+1 >> p

(Print Fibonacci numbers 1..1000)

0 >> a
1 >> b
?a<=1000:
    a >> $o
    a+b >> next
    b >> a
    next >> b
    ?a<=1000:
        a >> $o
        a+b >> next
        b >> a
        next >> b
        ?a<=1000:
            a >> $o
            a+b >> next
            b >> a
            next >> b
            ?a<=1000:
                a >> $o
                a+b >> next
                b >> a
                next >> b
                ?a<=1000:
                    a >> $o
                    a+b >> next
                    b >> a
                    next >> b
                    ?a<=1000:
                        a >> $o
                        a+b >> next
                        b >> a
                        next >> b