ID:168550
 
Anyone got a better way to do this/a way to do this that works? The code takes two direction values (a and b) and checks firstly that they're not the same, and then checks if they're opposites, returning 0 if they are. It seems to do nothing for some directions, and then return 1 if both a and b are equal to SOUTH. Anyways, the code:

proc/OppDir(a,b)//a and b are two directions
if(b==a) return 0 //if they're the same return 0
switch(a)
if(1||2)//if a is equal to 1 or 2
if(b==1||b==2)//and if b is equal to 1 or 2
return 1//they must be opposites, because they can't be the same
if(8||4)
if(b==8||b==4)
return 1
if(5||10)
if(b==5||b==10)
return 1
if(6||9)
if(b==6||b==9)
return 1
proc/Oppdir(a,b)
return (a == turn(b,180))

w00t turn proc!
In response to DerDragon
oooh thankee muchly... I should push f1 more often.