Skip to content

Ojave Plus Plus is a side project I have been working on where I intend to make a python-C++ hybrid language where learning is much easier compared to other languages.

Notifications You must be signed in to change notification settings

Normolo/O-Plus-Plus

Repository files navigation

O++

About

Ojave Plus Plus is a side project I have been working on where I intend to make a python-C++ hybrid language where learning is much easier compared to other languages.

Installation

  1. Download and execute installer.py
  2. Wait a bit while the program boots
  3. Enter install
  4. You now have O++! If you experience any errors within installation, check It's status page.
- Before installation
Welcome to the O++ Installer
You will now be entering a Command Line Interface in order to install O++
OPP//: : install
+ After installation
Welcome to the O++ Installer
You will now be entering a Command Line Interface in order to install O++
OPP//: : install
[                    ] 0%
[=====               ] 25%
[==========          ] 50%
[===============     ] 75%
[====================] 100%
Succesfully installed!
Enter exit on CLI to exit
OPP//: : exit

0. Installer CLI Commands

+ help
OPP//: : help
Command list
help - command list you are viewing right now
install - installs o++
exit - exits o++ installer
+ install
OPP//: : install
[                    ] 0%
[=====               ] 25%
[==========          ] 50%
[===============     ] 75%
[====================] 100%
Succesfully installed!
+ exit
OPP//: : exit
Exiting Installer

1. Hello World

We use the output function to call a Hello World string to be shown in the output

output['Hello World']

You can define the string to be short:

output[{short('Hello World')}]

or long:

output[{long(
    'Hello
    my dearest
    world'
)}]

If you want, you can have the {short} declaration with the parameters. You must have two {{-}} brackets when doing this. This will also get confusing when used {long} syntax. This is not reccommended:

output['Hello Paramter']
    par{{short}}


output['
hello
longer
parameter']
    par{{long}}

You can create a string at the beginning and then have it's content shown in the output:

store[{short('Hello World')}]
    par{name='stored_value_helloWorld'}
// This stores the Hello World String as 'stored_value_helloWorld'
output[store('store_value_helloWorld')]
// This outputs the string found in 'stored_value_helloWorld'

2. Input

Asking the user what their name is and then prints their name

You can do this by creating a input prompt that is put in the output, using the multi-function: input[output[]]. You can then store the input as the stringName user_name.

input[output[{short('What is your name? : ')}]]
    par{store[short(user_name)]}

If you want to then print the name, you can do so by calling username to be shown in the output, as seen below:

input[output[{short('What is your name? : ')}]]
    par{store[short(user_name)]}
output[store(user_name)]

3. Loops

Say you wanted to create a loop that outputs a number every second, like:

01 - 10
02 - 20
03 - 30
04 - 40
05 ...

This can be done by a loop. You can create a loop by making a create[loop] function, as ween below. This creates the loop that fires every second using the __TIME__

create[loop[increment{__TIME__('s')+1}]]
    par{name='loop'}

After you this, you'd need to create the number 01 in 01 - 10, this can be done via this script: This also dictates that the format has to be either 01 or 10.

create[num[1]]
    par{name='num1' , digit[format('0' , num[dig2] ;; num[dig1] , num[dig2])]}

The second number is created more easily by this script:

create[num[10]]
    par{name='num2'}

We then tell the script to execute:

loop('loop').run: //calls on loop 'loop' to run
    num[
        par{name='num1'} //+1s the first number
    ] + num[1]

    num[
        par{name='num2'}
    ] + num[10] //+10s the second number

    output[num['num1'] , '-' , num['num2']] //prints the output (02 - 20 and so on)

The script would then be:

create[loop[increment{__TIME__('s')+1}]]
    par{name='loop'}
create[num[10]]
    par{name='num2'}
loop('loop').run: //calls on loop 'loop' to run
    num[
        par{name='num1'} //+1s the first number
    ] + num[1]

    num[
        par{name='num2'}
    ] + num[10] //+10s the second number

    output[num['num1'] , '-' , num['num2']] //prints the output (02 - 20 and so on)

3. Making an enigma machine

Asks the user to input text to encode and the rotation setting

output[input('E: ')]
output[input('R: ')]

Set rotation constants

const[r.input] = input(ln[2])
const[r.rot.1] = 'MNBVCZASDFGHJKLPOIUYTREWQ'
const[r.rot.2] = 'QWERTYUIOPKJHGFDSAZXCVBNN'
const[r.rot.3] = 'OKMIJNUHBYGVTGVCFXZADEWQA'

Seperates the text to be encoding into 'X'

const[X] = function[seperate(input(ln[1])

Prepares the rotation configuration settings

if r.input = 1
    r.rot.1 = true
    r.rot.2 = false
    r.rot.3 = false
if r.input = 2
    r.rot.1 = false
    r.rot.2 = true
    r.rot.3 = false
if r.input = 3
    r.rot.1 = false
    r.rot.2 = false
    r.rot.3 = true

Runs enigma operations

const[X1] = function[math.randomize(char=r.input..true)]
const[X2] = function[math.power(X1).num(input(ln[1]))]

const[X3] = function[math.randomize(char=r.input..true)]
const[X4] = function[math.power(X3).num(input(ln[1]))]

const[X4] = function[math.randomize(char=r.input..true)]
const[X5] = function[math.power(X4).num(input(ln[1]))]

output[X5]

About

Ojave Plus Plus is a side project I have been working on where I intend to make a python-C++ hybrid language where learning is much easier compared to other languages.

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published