Learn to Code via Tutorials on Repl.it!

← Back to all posts
EeveeScript Tutorial Part 1
LoganSpong (45)

EeveeScript Beta 1.0


EeveeScript is a programming language based off of Assembly, but easier.

Key qualities

  • Jumping - Like functions, but let you move around the code.
  • Written in Python - Python is a very popular language, so making added EeveeScript functions should be easy.
  • Frequent updates - EeveeScript is always expanding!

Quick Start

Go into your shell
$ git clone https://github.com/InspyrePython/EeveeScript.git
$ cd path/to/EeveeScript

Exit, and open "code.eve" and type in your code,
After you're done, go into your shell again, and type this:
$ python main.py
And rinse and repeat!

Very Quick Start

Try on repl.it
Code in "code.eve".

Commands

CommandArgument(s)DescriptionSampleResources
_global startNoneStarts the program_global start
_global endNoneEnds the program_global end
pushint/strPushes int/str to the current stack.push 3
push $variablePushes variable to the current stack.push $foo
prtNonePrints current stack item at position of the pointer to the console.prt
printstrPrints str to console.print Hello World!
print $variablePrints variable to console.print $bar
delNoneDeletes current item at the location of the pointerdel
clNoneClears the stackcl
outNonePrints the current position of the pointerout
rNoneMoves the pointer rightr
lNoneMoves the pointer leftl
inNonePushes user input to stackin
movstack_nameMoves current stack to stack_namemov ebxSee Using Stacks
ifcondition, checkCompares item at position of pointer to check in some casesif eqSee Conditional Braching
elseNoneAfter if, if False, execute thiselse
endifNoneEnd conditional branchendif
forintFor int times, execute this codeforSee Control Flow
endforNoneEnd for loopendfor
intname, intAssign name a value of intint foo,34See Variables
strname, strAssign name a value of strstr bar,hiSee Variables
listname, listAssign name a value of listlist barfoo,34,34See Variables
addvariable1, variable2Add variable1 and variable2 together and store the result in variable1add bar,foo
subvariable1, variable2Subtract variable1 and variable2 and store the result in variable1sub bar,foo
mulvariable1, variable2Multiply variable1 and variable2 and store the result in variable1mul bar,foo
jmpstrJump to label strjmp fooSee Jumping
funcstrDefine strfunc fooSee Functions
funcNoneAfter func, stop defining func _str_funcSee Functions
endNoneAfter a label, stop defining that labelendSee Jumping
callfuncCall function funccall fooSee Functions
lprtlist, intPrint item int of list listlprt foo,1
apndlist, str\intAppend str/int to listapnd bar,hello
nNonePrint a newlinen
io.clearNoneClear the consoleio.clear
passNonePass and do nothingpass

To-do

  • for loops
  • ifs
  • fix jmp bug with for loops
  • get prt working again
  • freakin' LOOP NESTING
  • while loops

Using Stacks

There are 4 stacks in EeveeScript,

  • eax
  • ebx
  • ecx
  • and edx

All stacks behave the same.
As with the mov command, stack_name can be any one of these values.

Conditional Branching

if

The if command is easy to handle.
There are 8 different varieties for if

  • if eq; - Checks if the item at the position of the pointer is equal to the one next to it
  • if neq; - Checks if the item at the position of the pointer is not equal to the one next to it
  • if gr; - Checks if the item at the position of the pointer is greater than the one next to it
  • if ls; - Checks if the item at the position of the pointer is less than the one next to it
  • if eq check; - Checks if the item at the position of the pointer is equal to check
  • if neq check; - Checks if the item at the position of the pointer is not equal to check
  • if gr check; - Checks if the item at the position of the pointer is greater than check
  • if ls check; - Checks if the item at the position of the pointer is less than check

Note:
You cannot execute ifs inside of an if, you have to do something like this:

if eq north;
print North it is..
else
pass
endif
if eq south;
print South.. Ok.
else
pass
endif

If the result is False, we move on to...

else

Else executes the code under it if the if command above it resulted in False.
After, it goes to...

endif

Endif ends the if/else statement.

Control Flow

With the for command, we can repeat something x amount of times.
Example:

for 3
print bar

Note:
You can't put if inside for loops.
Yes, while is coming soon.

Jumping

jmp is a special command.
jmp is like a train with "stops" that are labels

What are "labels"?

Labels are words, followed by ":", that have code in the middle, and end with end.
An example of a label:

hello:
print hi
end

Ok, so what's the purpose?

jmp allows you to jump to labels.
Example:

say_hello:
print Hello!
end
for 3
jmp say_hello
endfor

Easy, right?

Variables

Variables can be assigned using list, str, or int, depending on the type you need.

Assigning Variables

Integers

int assigns an integer.
Example:

int foo,34

Now, foo is equal to 34.
We can check that by saying:

print $foo

It will print "34". Great!

Strings

str assigns an string.
Example:

str foo,hello

Now, foo is equal to "hello".
We can check that by saying:

print $foo

It will print "hello". Great!

Lists

list assigns an list.
Example:

list foo,34,45,hello

Now, foo is equal to [34, 45, "hello"].
We can check that by saying:

print $foo

It will print "[34, 45, "hello"]". Great!

We can change the list by using apnd.
Example:

apnd foo,"bye"

apnd appends a value to the list.
Did it work?
We can test that by doing:

print $foo

It will print "[34, 45, "hello", "bye"]".
Nice!

We can print certain list items with lprt.
Example:

lprt foo,3

This prints item 3 of the list foo.
The output is "bye".
Awesome!

Functions

You can define a function using func.
Example:

func hello
print hello
func

We just defined the function hello.
To call it, simply type call hello.
<br>
Output: hello
<br>
Great!

Commentshotnewtop
LoganSpong (45)

I loathe repl.it tables. So messy!