Simple Calculator for GMS2
This is project for incoming tutorial video.
Calculates expression from string.
- Supports numbers with dot.
- Supports binary operators: + - / * ^
- Supports unary operators: + -
- Supports parenthesis: ( )
- So you can do calculation like: -5.3*5/(+4 +.4^5)*(((-1)))
- Uses Pratt Parser for parsing tokens
- Builds Abstract Syntax Tree (AST) for executing
- You can drag nodes of visual representation of AST.
Status | Released |
Category | Assets |
Author | TeroHannula |
Made with | GameMaker |
Tags | abstract-syntax-tree, calculator, evaluate, execute, GameMaker, gamemaker-studio-2, gms2, parsing, pratt-parser, scanning |
Download
Download NowName your own price
Click download now to get access to the following files:
SimpleCalculator.yymps 118 kB
Simple Calculator.zip 1.9 MB
Comments
Log in with itch.io to leave a comment.
hi, I have a idea for a game using this example. What is the licence of it?
Hello there, I actually haven't thought about licensing, just put so it's free to use. Never did the tutorial video though about this :D
;) How long have you been programming anyway? And how long have you been doing it in GameMaker? Your code is not the simplest. ;)
Got carried away haha, it was meant to be expandable (possiblity for adding new rules etc.) and be explained in-depth in separate video. I guess I have been using GameMaker for 15 years.