Contest: Animal/Bot Coding (AI)

Online C++ programming contests.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo

Is this a good idea or not?

Poll ended at Sun Aug 22, 2004 12:10 pm

Yes
19
100%
No
0
No votes
 
Total votes : 19

Postby Corsix » Thu Aug 26, 2004 4:10 pm

roboticguy2: I assume you are trying the GUI - you need to change the project to Win32 app not console. Go into project build options and change subsystem:console to subsystem:windows
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby TheKidder » Thu Aug 26, 2004 4:27 pm

ha :lol:
I can't believe I forgot that :oops:

[edit]Win32 GUI Comments:
-The animal status in the bottom is too short (for my animal it only shows "Roboticguy2_Rabidchipmunk: ")
-When I exit, I get an error (The instruction at "[location here]" referenced memory at [location here]". The memory could not be "read".
w00t!
User avatar
TheKidder
 
Posts: 525
Joined: Mon Nov 24, 2003 7:57 pm
Location: MI

Postby r4nd0m » Thu Aug 26, 2004 4:50 pm

was that my win32 gui? because if it was, yea i've noticed a bunch of problems. one of the biggest, is like you said when it exits. I don't really know why it does that as of yet, but i'll try and fix it. Also, if you get a lot of animals going, and you have a relatively slow computer, the program appears to freeze - it doesn't respond to anything you do. this is because it is processing all your rapidly breeding animals, and isn't gettting any window messages. i think the only [logical] way to fix this would be to start a separate thread which manages the animals. I've fixed some of the more minor issues, but those two are still big, ugly and annoying. you can dl the patch right here.

[..edit..]
or you can simply upgrade to v0.3 of the GUI, which fixes pretty much everything except the "freezing" of the computer due to the processing of the animals.
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby Corsix » Fri Aug 27, 2004 1:09 pm

I have improved the __int__Rand function so that it should run faster:
Code: Select all
long __int__Rand(long Min, long Max) // Returns a random number between Min and Max
{
   if(Min > Max)
      return __int__Rand(Max,Min);
   if(Min == Max)
      return Min;
   return (rand() % (Max-Min))+Min;
}
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Darobat » Fri Aug 27, 2004 3:12 pm

I was doing so expierements with your old random function and the first number it generated is always the same. The ones following it were different, but the first never changed . The interval 1-5 always gave me 4 as the first number. The new one works better.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby r4nd0m » Fri Aug 27, 2004 8:51 pm

Again, when are these animals due by, tomorrow [aug. 28], or a week from tomorrow [sept. 4]?? Also, how many species are we allowed to enter?
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby Corsix » Sat Aug 28, 2004 4:56 am

I wrote:Submit:
Upto 5 .h files which include your animals and or any helper functions. Please prefix all files,classes and functions wih your name to avoid conflicts.
Deadline
All animals must reach me (Corsix@PlanetUnreal.com) by 5:00 PM GMT, Saturday 4th of September. However, after that the contest will probably be re-held fortnightly (eg. you can improve your bot and then re-enter).
Rules
No more than 5 (five) animals to be submitted per user per round.
Have fun :)
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby exomo » Sat Aug 28, 2004 10:17 am

No more than 5 (five) animals to be submitted per user per round.
Does this mean our 5 animals (if we have 5) are fighting together? Or only one a time?[/quote]
User avatar
exomo
 
Posts: 879
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby r4nd0m » Sat Aug 28, 2004 11:01 am

erm... sry Corsix, musta missed that. can we just put all our animals in one .h file? also, for any functions that are members of our classes, do we need to put our name on those?
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby Corsix » Sat Aug 28, 2004 11:09 am

You can submit upto 5 .h files thus you can distribute your animals and functions across those as you wish. Functions inside classes do not need your name of them (eg. Fred123_MyAnimal::CallThisToDoStuff())

Exomo, i dont quite understand your question, an Attack() can only take place between 2 animals / all your animals will be inserted into the same world.
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby r4nd0m » Sat Aug 28, 2004 11:50 am

I think he means, if you have 5 species, will only one be spawned in a "round of 1000 turns", or willall 5 be spawned.
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby RecursiveS » Sat Aug 28, 2004 1:26 pm

As I understand it, all the header files will be included into the same virtual world, a number of each animals spawned and then.....MAYHEM!!!!!!


:lol:
User avatar
RecursiveS
Site Admin
 
Posts: 1236
Joined: Thu Sep 18, 2003 8:33 am
Location: Dorset, UK

Postby Corsix » Sat Aug 28, 2004 2:27 pm

RecursiveS wrote:As I understand it, all the header files will be included into the same virtual world, a number (20) of each animals spawned and then.....MAYHEM!!!!!!

Correct
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Zen » Sat Aug 28, 2004 4:25 pm

How would I go about to find out whether an animal is herbi or carni ?

I've tried dynamic_cast, but it says:
c:\Dump\animal\Copy (2): error C2259: 'Carnivore' : cannot instantiate abstract class
c:\Dump\animal\Copy (2): error C2680: 'Carnivore' : invalid target type for dynamic_cast


This should be possible, right?

PS: If you want to try the graphics: www.home.no/ojb/animals_glut.rar

Disclaimer: I can not guarantee that this package will behave exacly as the original. (I might have messed up when doing the edit)
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

Postby Beer Hunter » Sat Aug 28, 2004 5:35 pm

Zen wrote:How would I go about to find out whether an animal is herbi or carni ?

I've tried dynamic_cast, but it says:
c:\Dump\animal\Copy (2): error C2259: 'Carnivore' : cannot instantiate abstract class
c:\Dump\animal\Copy (2): error C2680: 'Carnivore' : invalid target type for dynamic_cast
You can't dynamic_cast to a value type. Try a pointer type.
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

PreviousNext

Return to Contests

Who is online

Users browsing this forum: No registered users and 1 guest