The Integrated Processor is the latest addition to the Programmable Processor Mod. It is built to stream line the development process and increase the usability. The Scrap Mechanic Programming Language (SMPL in short) is a custom programming language currently in a prototype state where most of the features are in place. There is still room for improvement and changes being made.
This guide will cover the language itself but also how to create and add new modules to speed up computations or add new functionalities.
Integrated Processor
[COMING SOON]
Scrap Mechanic Programming Language (SMPL)
Here is a list of all existing unary operators that can be overloaded.
+ pos - neg ! lnot ~ bnot
This is a list of all binary operators.
+ add - sub * mul / div % mod ** pow << bshl >> bshr <<< lshl >>> lshr < less > greater <= leq >= geq == equal != unequal & band ^ bxor | | bor && land ^^ lxor || lor
External Modules
[COMING SOON]
Examples
Complex Number Cla*s
cla*s ComplexNumber def ComplexNumber(r, i) this.r = r this.i = i end def mul(other) return ComplexNumber(this.r * other.r - this.i * other.i, this.i * other.r + this.r * other.i) end def add(other) return ComplexNumber(this.r + other.r, this.i + other.i) end end
This is all for Scrap Mechanic Scrap Mechanic Programming Language hope you enjoy the post. If you believe we forget or we should update the post please let us know via comment, we will try our best to fix how fast is possible! Have a great day!
- Check All Scrap Mechanic Posts List
Leave a Reply