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

Views: 439

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: 4D-Hypercube/Tesseract
Rating: 6.1111
Filesize: 130.4 kB
Downloads: 1792
Comments: 16
Ratings: 3
Date added: 2015/12/13 14:16:10
Made with: Algodoo v2.1.0
Rating: rated 6.1
download
Title: perplexing paperclips and bands
Rating: 5
Filesize: 108.96 kB
Downloads: 110
Comments: 0
Ratings: 1
Date added: 2026/01/11 21:42:15
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: code lock
Rating: 5.625
Filesize: 123.71 kB
Downloads: 599
Comments: 5
Ratings: 2
Date added: 2010/12/15 19:20:35
Made with: Phun
Rating: rated 5.6
download
Title: Morse Code Machine
Rating: 5.625
Filesize: 231.1 kB
Downloads: 2560
Comments: 4
Ratings: 2
Date added: 2013/07/23 00:14:11
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Code Generator(not working atm)
Rating: 5
Filesize: 14.03 kB
Downloads: 506
Comments: 1
Ratings: 1
Date added: 2014/06/06 20:40:42
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Logic Gates
Rating: 5
Filesize: 110.55 kB
Downloads: 725
Comments: 4
Ratings: 1
Date added: 2023/06/24 22:09:14
Made with: Algodoo v2.1.0
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