serprex
|
|
Reply #15 Posted on: March 27, 2010, 08:19:49 am |
|
|
Smooth ER
Joined: Apr 2008
Posts: 106
|
It isn't slow. Inlinining+Compiler Optimizations will make it faster than a generic loop. See http://en.wikipedia.org/wiki/Loop_unwindingC99 states that a function need only be able to accept 127 arguments, this solution removes that limit
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #16 Posted on: March 27, 2010, 08:21:53 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Not that I think anyone that needs the min() or max() of that many arguments shouldn't be using an array and iterating it him/herself. It's just nice to shed GM's limits.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #20 Posted on: March 27, 2010, 09:06:24 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Game_boy: Not at present; I could generate one, but I don't think some of the systems I coded are all in there. Like text file manipulation and DLL's.
The 11th plague of Egypt: Assuming you're talking about ds_lists, they are global. Don't worry, this new system won't break ds_list; it'll supply an alternative to them. Lists are stored somewhat like sprites; a global array of things GM users don't understand, which they can access by an integer from absolutely anywhere. So, a=ds_list_create() will add to that list, "list a;" won't.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Game_boy
|
|
Reply #21 Posted on: March 27, 2010, 10:56:09 am |
|
|
Joined: Apr 2008
Posts: 228
|
a global array of things GM users don't understand This gave me an awesome and disturbing mental image. So this array encircles the world and contains everything that every GM user doesn't understand? Everything? Including Yoyo's business model, how their computer works, cheesy Wotsits, how to code multplayer that doesn't fail, the Central Limit Theorem, and quantum mechanics? (Yes, I do understand what you really meant)
|
|
« Last Edit: March 27, 2010, 11:29:40 am by Game_boy »
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #22 Posted on: March 27, 2010, 12:32:18 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Bahaha, yes, all of those things.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
serprex
|
|
Reply #24 Posted on: March 27, 2010, 10:05:53 pm |
|
|
Smooth ER
Joined: Apr 2008
Posts: 106
|
Mean can be parsed mean(a,b,c) -> add(a,add(b,c))/argc Choose can be parsed choose(a,b,c) -> *((var*[]){&a,&b,&c})[randint(argc)]
|
|
« Last Edit: March 28, 2010, 07:16:00 am by serprex »
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #25 Posted on: March 27, 2010, 10:09:54 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Man, that's hackish even by my standards. I'll do it.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #27 Posted on: March 28, 2010, 10:04:10 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Actually, are you sure that casting that initializer as var will properly allocate them? (I'd cast as variant anyway, but...)
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|