Skip to content

This script evaluates a series of assignment operators and prints the final values of the variables.

Notifications You must be signed in to change notification settings

harshjain30/Text-Based-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Text-Based-Calculator

This script evaluates a series of assignment operators provided as command-line input and prints the final values of the variables.

Operators
The following operators are valid:
=, *=, /=, +=, -=, +, -, *, /, ++, --
This version does not work for other operators such as (), ^, |, %, ~, etc.

Variables
The variable names can be anything as long as they don't include one of the operators and have atleast one non-numeric character other than "." (decimal point). For example: i, count, #awesome, y2k, @mention, $%.^&, etc.

Numbers
The script does not work for negative numbers. All non-negative real numbers are okay.

For example,
i = 0
j = ++i
x = i++ + 5
y = 5 + 3 * 10
i += y

Result:
{i=37, j=1, x=6, y= 35}

About

This script evaluates a series of assignment operators and prints the final values of the variables.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages