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 23rd, 2004, 08:56 PM
YaiEf YaiEf is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 YaiEf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[appleeaters]Compare :)

You can compare your own strategy with a somewhat decent attempt at: www.noka.dk/robots
The map size is 20 to 50 and the game.txt is generated on each reload, so you can download it and try it yourself - just remember to fill in the "randomsleft" which doesn't work in the current version (BUG).

Feel free to post what you think of the strategy I'm using - I know there are some things that don't work quite right (danger-detection for one thing ...), but comments are always welcome. Oh, and the rendering doesn't always work that well for some reason or other.

Alright, time to go back to my studies ... have to focus on exams, focus ...

And btw - how about not just crashing out at 60 seconds max - but simply having a counter and then stop the game at 60 seconds and assign the points aquired at that time? That seems a lot more fair than the current rules.

Reply With Quote
  #2  
Old May 24th, 2004, 02:50 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[appleeaters]RE: Compare :)

could you post the code you used for the table creation?

thx.

Reply With Quote
  #3  
Old May 24th, 2004, 06:26 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[appleeaters]RE: Compare :)

Here's what I use. It's meant to be used inside pre tags to get a monospace font which I found renders faster for me than tables. Changing to tables is trivial.

php Code:
Original - php Code
  1.     function draw_game_area() {
  2.         // initialize screen
  3.         $screen = array();
  4.         for($x=0; $x<$this->game["height"]; $x++) {
  5.             $screenline = array();
  6.             for($y=0; $y<$this->game["width"]; $y++) {
  7.                 array_push($screenline, "&nbsp;");
  8.             }
  9.             array_push($screen, $screenline);
  10.         }
  11.        
  12.         // add ****
  13.         $the**** = array("robots", "apples", "deadrobots");
  14.         foreach($the**** as $****) {
  15.             foreach($this->game[$****] as $item) {
  16.                 $screen[$item[1]-1][$item[0]-1]=substr($****,0,1);
  17.             }
  18.         }
  19.        
  20.         // add me
  21.         $screen[$this->game["player"][1]-1][$this->game["player"][0]-1]="p";
  22.        
  23.         // display
  24.         foreach($screen as $screenline) {
  25.             foreach($screenline as $character) {
  26.                 echo "$character";
  27.             }
  28.             echo "n";
  29.         }
  30.     }

Reply With Quote
  #4  
Old May 24th, 2004, 08:56 AM
YaiEf YaiEf is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 YaiEf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[appleeaters]RE: Compare :)

Well, I decided not to compete and focus on exams and work instead ...

So I added a show_source - I guess my code can serve as inspiration or perhaps an example of how not to code PHP ;) It needs at least one total rewrite ...

Reply With Quote
  #5  
Old May 24th, 2004, 10:08 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[appleeaters]RE: Compare :)

thx, contest doesn't end until june 21, does your school go that late? (mine is out).

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [appleeaters]Compare :)


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


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





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