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: 640

Views: 456

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: perplexing paperclips and bands
Rating: 5
Filesize: 108.96 kB
Downloads: 147
Comments: 0
Ratings: 1
Date added: 2026/01/11 21:42:15
Made with: Algodoo v2.2.4
Rating: rated 5
download
Title: Human Code
Rating: 5
Filesize: 38.83 kB
Downloads: 1202
Comments: 0
Ratings: 1
Date added: 2020/03/28 22:02:57
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: SELF-MODIFYING CODE
Rating: 5.625
Filesize: 16.28 kB
Downloads: 732
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: Logic Gates
Rating: 5
Filesize: 110.55 kB
Downloads: 746
Comments: 4
Ratings: 1
Date added: 2023/06/24 22:09:14
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: One Hit Wonder
Rating: 5
Filesize: 24.06 kB
Downloads: 550
Comments: 3
Ratings: 1
Date added: 2012/10/21 11:36:14
Made with: Algodoo v2.0.2 Edu
Rating: rated 5
download
Title: Another Volcano
Rating: 5
Filesize: 34.22 kB
Downloads: 856
Comments: 1
Ratings: 1
Date added: 2011/04/03 17:42:09
Made with: Algodoo before v1.8.5
Rating: rated 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