POST HERE YOUR SCRIPTS!

About advanced scenes, and the Thyme scripting language used in Algodoo.

POST HERE YOUR SCRIPTS!

Postby lololoer16_17 » Tue Mar 04, 2014 8:19 pm

Post here your functions, maybe you cn find new ones that would help you and you could help people too!
If this post gets lucky it will have a very helpful position on the forum, so please if you wanna ask any function just ask it here!

Thankyou!
lololoer16_17
 
Posts: 18
Joined: Tue Jan 21, 2014 8:55 pm
Location: Spain (South)

Re: POST HERE YOUR SCRIPTS!

Postby lololoer16_17 » Fri Mar 14, 2014 7:49 pm

METHOD

Introduction:

If you wanna substract an element from a really really large function you should use this method.

How to get an specific "function element"? :

Code: Select all
EXAMPLE FUNCTION
Function = (variable1, variable2, Specific_Element)=>{
    variable1_length = string.length(variable1) - 1;
    index = variable1_length - 3;
    formula = (variable1(index) / (math.cos(variable2)));
    eval("" + Specific_Element)
}

Where eval("" + Specific_Element) is the "function element" to ask for.

For example:

INPUT: Function([1,2,3,4,5,6,7], 500, "formula") OUTPUT: -4.5256586
lololoer16_17
 
Posts: 18
Joined: Tue Jan 21, 2014 8:55 pm
Location: Spain (South)


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests