It is currently Fri Jan 19, 2018 3:37 pm Advanced search

How to use the tutorial with C++?

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

How to use the tutorial with C++?

Postby stupidquestions » Wed Nov 16, 2011 1:31 pm

First of all, I'm using Windows 7.
In the tutorial, we have to put something like "python tools/playgame.py "python MyBot.py" "python tools/sample_bots/python/HunterBot.py" --map_file tools/maps/example/tutorial1.map --log_dir game_logs --turns 60 --scenario --food none --player_seed 7 --verbose -e" in a text document named "tutorial" and then run tutorial. So I guess that, instead of "python Mybot.py" I should use MyBot from the C++ starter package... What exactly should I write instead of "python Mybot.py"? I installed MinGW (and added its path) and tried writing stuff like "g++ MyBot.cpp" or "g++ Mybot.cpp State.cpp" and similar, but the result is always the same: When I run tutorial, I see the map, but nothing is happening, ants aren't moving.
Sorry if this is a stupid question, but I don't really have much experience using the terminal in Windows...
stupidquestions
Captain
 
Posts: 23
Joined: Wed Nov 16, 2011 1:02 pm

Re: How to use the tutorial with C++?

Postby gnu264 » Wed Nov 16, 2011 5:51 pm

1. Compile your C++ code -> you will get an .exe file
2. In the file "tutorial.cmd", replace the "python MyBot.py" with "C:\path\to\my\bot.exe"
gnu264
Captain
 
Posts: 23
Joined: Tue Nov 08, 2011 5:27 pm

Re: How to use the tutorial with C++?

Postby stupidquestions » Wed Nov 16, 2011 6:19 pm

Thanks, but I still can't make it work. I put ALL the .cc and .h files from the starter kit in a CodeBlocks project called "projekt1" and compiled that project. The only .exe file that I got as a result of that was projekt1.exe in C:\aichallenge\projekt1\projekt1\bin\Debug, so I replaced "python MyBot.py" with "C:\aichallenge\projekt1\projekt1\bin\Debug\projekt1.exe", but that didn't help me...

EDIT: I made a stupid mistake, everything works fine now, thanks again. :)
stupidquestions
Captain
 
Posts: 23
Joined: Wed Nov 16, 2011 1:02 pm


Return to Starter Packages & Tools

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron