Scrap Mechanic Scrap Mechanic Programming Language

Scrap Mechanic Scrap Mechanic Programming Language 1 - steamsplay.com
Scrap Mechanic Scrap Mechanic Programming Language 1 - steamsplay.com

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 Class
 
 

class 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!
 


Be the first to comment

Leave a Reply

Your email address will not be published.


*