Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old May 30th, 2004, 08:54 AM
yarin yarin is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 yarin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[appleeaters]1 goes left instead of left and down!

Hello!

If I do
$cR->move(1);

the robotslib prints out
The player moved from (97,100 ) to (96,100 ) (command: 1)
Instead of "to (96,99)"!

First I assumed a coding mistake in robotslib.php. The corresponding code passage looks like this:

case 1:
$this->player[0]--;
$this->player[1]--;
break;

If I print_r the $this->player array before break; it says

Array ( [0] => 96 [1] => 100 )

How can that be?


Thank you very much,
Yarin

Reply With Quote
  #2  
Old May 30th, 2004, 09:22 AM
cirox cirox is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 7 cirox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to cirox
[appleeaters]RE: 1 goes left instead of left and down!

I've seen this error before too (causes the robots AND the player to only be able to move left/right), but couldn't find a fix for it, so I restored to the original copy of robotslib and generated a new game and the bug went away. The only thing I could come up with in my mind was that PHP crapped out for some unknown reason and couldn't write to the Y co-ordinate.

One other thing to check: when using $robots->move($move), make sure to capture the return into $game or some other variable. It may be that you're not recapturing the $game variable and that somehow, PHP is copying the old value back in to the new or something like that. But past that I have absolutely no idea. I just remember that's some of the things that ran through my mind when I ran into the problem a few days ago. Hope that helps..

Reply With Quote
  #3  
Old May 30th, 2004, 09:25 AM
yarin yarin is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 yarin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[appleeaters]RE: 1 goes left instead of left and down!

Thanks for your reply.
Meanwhile I found 2 bugfixes:

1. Turn $this->player[1]--; into $this->player[1] = $this->player[1] - 1; will work.
2. Fidians (great) extended robotslib.php does not have this bug [and works even better] --> http://rumkin.com/php_contest/ Thanks Fidian!

Reply With Quote
  #4  
Old July 24th, 2004, 01:36 PM
fidian fidian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 45 fidian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[appleeaters]RE: 1 goes left instead of left and down!

The URL is now http://rumkin.com/reference/php_contest/

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [appleeaters]1 goes left instead of left and down!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway