Retrogamecoding(.org) > Examples

Simple turtle library for EGSL

<< < (2/4) > >>

Bereb:

--- Quote from: Tomaaz on November 13, 2012, 02:09:36 AM ---But I needed to fix line 25 to make it work: local sin, cos, rad = math.sin, math.cos, math.rad --(faster if declared as local)
--- End quote ---
Oh, sorry   :-[
This comment was not in the original script. I added it afterwards to point the trick : when variables are declared as 'local', programs run faster. It's obvious especially with fractals (I've got some samples and have tested them with other prog. languages, see there). Thus these sorts of program run up to 5 or 6 times faster and then EGSL (and consequently Lua) has no cause to be envious of some other compiled programing languages  ;)

Cybermonkey:
Good to know (with that local declaration). Although the EGSL implemented sin, cos etc. are implemented in Pascal and are compiled ...  ;)
EDIT: Hm, forget that I was talking rubbish ... The math.sin etc. are implemented in C, right? So Pascal can't be faster.

Bereb:

--- Quote from: Cybermonkey on November 13, 2012, 09:27:19 AM ---Although the EGSL implemented sin, cos etc. are implemented in Pascal and are compiled ...  ;)

--- End quote ---
Yes. I go on  declaring them out of a bad habit, that I'v got before  I notice the EGSL helper functions, sorry !

lelldorin:
Hello All,

can i add this example as part of my EGSL IDE?

http://haikuware.com/directory/view-details/development/ides/egsl-ide

Tomaaz:
I'm not sure if you're asking about my simple library or Bereb's work, but if it's my library, feel free to use it and all my examples.

Regards!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version