Plese some more people start playing in the ladder! :)

For the 1on1 Ladder on PlanetNexuiz

Moderators: Nexuiz Moderators, Moderators, Ladder Moderators

Postby kozak6 » Fri Mar 17, 2006 7:58 pm

I'd join in if there were any point in doing so.
kozak6
Alien trapper
 
Posts: 418
Joined: Wed Mar 01, 2006 9:22 pm
Location: AZ

Postby tChr » Fri Mar 17, 2006 8:28 pm

kozak6 wrote:I'd join in if there were any point in doing so.

Wy isnt there? There should be at least 3 US servers now.
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway

Postby KadaverJack » Fri Mar 17, 2006 8:38 pm

tChr wrote:
Code: Select all
function pointRangeOk ($session_id, $enemy_id) {
   global £prefix, $conn, $pointrange;
   if ((get_playerpoints($enemy_id) - get_playerpoints($session_id)) <= $pointrange)  return true;
   return false;
}

I see bloat there! :D
I would suggest:
Code: Select all
function pointRangeOk ($session_id, $enemy_id) {
   global $prefix, $conn, $pointrange;
   return (get_playerpoints($enemy_id) - get_playerpoints($session_id)) <= $pointrange;
}
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby tChr » Sat Mar 18, 2006 1:29 am

KadaverJack wrote:
tChr wrote:
Code: Select all
function pointRangeOk ($session_id, $enemy_id) {
   global £prefix, $conn, $pointrange;
   if ((get_playerpoints($enemy_id) - get_playerpoints($session_id)) <= $pointrange)  return true;
   return false;
}

I see bloat there! :D
I would suggest:
Code: Select all
function pointRangeOk ($session_id, $enemy_id) {
   global $prefix, $conn, $pointrange;
   return (get_playerpoints($enemy_id) - get_playerpoints($session_id)) <= $pointrange;
}


Hmm,.. you're right :)
allthough:

Code: Select all
function pointRangeOk ($session_id, $enemy_id, $pointrange) {
   return (get_playerpoints($enemy_id) - get_playerpoints($session_id)) <= $pointrange;
}

Is even better :)
Then again.. why put it in a function.. unless you use it more than one place, that is :)
Edit: but still Greens way is a bit easier to debug :)
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway

Postby GreEn`mArine » Sat Mar 18, 2006 8:47 am

I know that this if {} else {} thing is actually not needed in the function but I like it anyway ("return xx" would break the function anyway)

as this pointranke function IS used several times (not only for displaying the link but also for checking, whether the user is allowed to see the "Challenge" page, it is the easiest thing to have it in a function and not in every php page
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby tChr » Sat Mar 18, 2006 12:11 pm

I dont thek anyone means to critizise your code :D IWe just like to make a mindfuck of about everythign :)
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway

Previous

Return to Nexuiz Ladders - 1on1

Who is online

Users browsing this forum: No registered users and 1 guest

cron