This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
331
Proposals / Re: Some things just have to be deprecated
« on: December 12, 2008, 10:40:32 am »EDL as it is in GM should definitely only be in a special compatibility mode. Instead, the real EDL language should have some more logical restrictions, and better organization of functions.Why push() instead of ds_list_add() in EDL?
GM Code:
if variable_local_exists("Counter")
{
Counter+=1
ds_list_add(myList,Counter)
}
else
{
Counter=0
myList = ds_list_create()
}
EDL Equivalent
//Static variables are used instead, this code can be thought of 'only executing the first time', it is not set to 0 every time it is run
static int Counter = 0;//=0 is optional, in C++ static variables are always initialized to 0
static list myList; //creates an empty list if one is not created
Counter++
push(myList,Counter)
332
Function Peer Review / Re: The formula for finding point_distance.
« on: November 15, 2008, 02:38:24 pm »All square numbers are positive.Of course I was... testing.
333
Function Peer Review / Re: The formula for finding point_distance.
« on: October 22, 2008, 10:32:26 am »I'm sure you already have this, but i'm trying to help.That would be uneffecient. Why not:Code: [Select]#include <math.h>
double point_distance(double x1,double y1,double x2,double y2)
{
return (double) sqrt( ((x2-x1)*(x2-x1)) + ((y2-y1)*(y2-y1)) );
}
Code: [Select]
#include <math.h>
double point_distance(double x1,double y1,double x2,double y2)
{
int x_diff,y_diff;
x_diff = x2-x1;
y_diff = y2-y1;
return (double)sqrt((x_diff*x_diff)+(y_diff*y_diff));
}
Not sure how old this topic is, though xDEDIT:
Sorry, didn't notice Josh's post.
334
Tips, Tutorials, Examples / Re: A Few Alternate Functions
« on: October 17, 2008, 03:48:24 am »
LOL
If I may. Really.
If I may. Really.