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:
  #1  
Old May 30th, 2004, 09: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, 10: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, 10: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, 02: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: 3
[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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek