Browse Search Popular Register Upload Rules User list Login:
Search:
Useful Code Snippets

Image:
screenshot of the scene

Author: TheBumpkin

Group: Default

Filesize: 152.09 kB

Date added: 2014-03-28

Rating: 5

Downloads: 613

Views: 402

Comments: 6

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

A selection of a couple of dozen little code snippets I use from time to time. Includes a mostly complete set of string handling routines that are missing in thyme. Stuff like substring and replace. Also includes a few simple math routines like rounding and absolute value. Last but not least, there is one array function for swapping elements. I am sure some or all of this has been done by somebody before, but it was a fun thing to put together anyway. Hope someone finds it useful....Thanx to xray for the "auto play mode" idea.
Please log in to rate this scene
edit
Similar scenes
Title: Rotary Ball Sort Lite (less code)
Rating: 5
Filesize: 100.9 kB
Downloads: 778
Comments: 9
Ratings: 1
Date added: 2024/08/10 00:22:36
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Human Code
Rating: 5
Filesize: 38.83 kB
Downloads: 1167
Comments: 0
Ratings: 1
Date added: 2020/03/28 22:02:57
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Morse Code Machine
Rating: 5.625
Filesize: 231.1 kB
Downloads: 2526
Comments: 4
Ratings: 2
Date added: 2013/07/23 00:14:11
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: SELF-MODIFYING CODE
Rating: 5.625
Filesize: 16.28 kB
Downloads: 702
Comments: 2
Ratings: 2
Date added: 2013/01/10 07:45:37
Made with: Algodoo v2.0.2 Edu
Rating: rated 5.6
download
Title: Another Volcano
Rating: 5
Filesize: 34.22 kB
Downloads: 797
Comments: 1
Ratings: 1
Date added: 2011/04/03 17:42:09
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: Solid 3D Cube
Rating: 6.5
Filesize: 22.79 kB
Downloads: 4000
Comments: 26
Ratings: 4
Date added: 2023/02/26 18:22:00
Made with: Algodoo v2.1.0
Rating: rated 6.5
download
WOW! This is AWESOME! THANKS! _o_
scene.my.abs = (n) => {n >= 0 ? {n}:{-n}}
there is no need for {}
scene.my.abs = (n) => {n >= 0 ? n : -n}
Why don't you post all of it in forum? Besides, most of this already there;)
"For" is only 40 iteration deep, I recommend to decline and use "xFor". Look for it in forum.
Nice demo. Algodoo already has distance function.

math.vec.dist
(a, b)=>{
math.vec.len(a - b)
}
I don't understand very good, maybe I'm missing my thyme competency..
Last edited at 2014/03/28 16:06:06 by lololoer