Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

The progress so far in a single picture.

Input:

"Hello world"; 
22.4; .2; 
2.7.4; 
"2.47.4"; 
1 - -3; 
1 + -4; 
A += 1; 
B -= 2.3; 
C *= .2; 
D /= 5; 
E %= 7; 
2.;
                     .2; 
"                    .2";

Output:

["Hello  world"] 
[22.4] 
[0.2] 
Error 
[] 
["2.47.4"] 
[1, 3] 
[1, -4] 
[A, +=, 1] 
[B, -=, 2.3] 
[C, *=, 0.2] 
[D, /=, 5] 
[E, %=, 7] 
Error 
[] 
[0.2] 
"                    .2"

So far its working exactly as intended.

Today I spent most of the time optimizing the program. Made sure there were no useless variables, cut short many lines of code, documented some parts of the code, etc. I also implemented operator grouping, so the program can identify separate back-to-back operators like + and = and combine them into a single operator +=. The result of this can be seen in the output above. We are just a few more steps away from actually letting the program do these operations and return the result. Before that, we need to implement identifier (variable) recognition, order identification so our program knows the order in which operations need to be executed (Our language uses BODMAS or PEMDAS order), and command type recognition, so the program can differentiate between declaration, assignment, etc.

Also, I have remove ++ and -- operators from the language vocabulary. It was such a pain to implement and served no real purpose in my opinion.