[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - C# Tutorial

It is currently Fri Jun 22, 2018 9:23 am Advanced search

C# Tutorial

Code won't compile? Found a bug? Post here!

C# Tutorial

Postby sam7 » Sat Feb 20, 2010 2:34 am

HI, does anyone have a quik and easy tutorial how to get the C# version up an running on windows?
Thanks!
sam7
Cadet
 
Posts: 2
Joined: Sat Feb 20, 2010 2:29 am

Re: C# Tutorial

Postby dutchflyboy » Sat Feb 20, 2010 1:52 pm

1. Download Visual Studio Express C#
2. Install it
3. Start Visual Studio Express C#
4. Create a new project, select "Console application" as predefined type, give it a name and create it (before creating, note the directory where the project will be saved).
5. Rename "Program.cs" to "MyTronBot.cs"
6. Write your code
7. When you've finished your code, go to your project's directory, select all .cs files and put them in a zip file (if you don't have any program to do this, you could use
8. Upload the code
9. Win!
dutchflyboy
Colonel
 
Posts: 57
Joined: Sun Feb 07, 2010 1:08 am

Re: C# Tutorial

Postby sam7 » Sun Feb 21, 2010 3:13 am

Fantastic. thanks for that.
Now how do I test it locally and debug through it?
Cheers, .sam
sam7
Cadet
 
Posts: 2
Joined: Sat Feb 20, 2010 2:29 am

Re: C# Tutorial

Postby Krishmin » Sun Feb 21, 2010 6:53 pm

At least for me, I'm debugging by writing to a logfile. You can also write to the console, but that makes things look a little confusing. Just make sure you disable the logfile before you upload your version to the server. As far as debugging on your system, you can run it through the java command (e.g. java -jar java/engine/Tron.jar java/maps/empty-room.txt "<your .exe>" "<your .exe"), where the executables are two different versions you want to play against each other. I'm actually using nneonneo's excellent Python tournament program (), which is both more aesthetically pleasing and functional.
Krishmin
Cadet
 
Posts: 4
Joined: Thu Feb 11, 2010 7:48 pm

Re: C# Tutorial

Postby analyst74 » Mon Feb 22, 2010 7:17 am

To test locally, you have a few options:

1, play against simple bots came with starter package;
2, play against a friend's bot
3, play against an earlier version of your bot (hopefully with slightly different actions)

those debug options are to make sure your bot doesn't crash, you need to test on at least one big map (e.g. huge-room.txt)

to debug logical errors, upload your bot and let it play against others, find out your lost games and analyze it yourself, find out at which point your bot made the wrong move that caused it to lose, then use callingwire's excellent tool to copy from game viewer to map file ().
Then locally, start debugging from Visual Studio, paste the map state in there, then debug through it to see what caused your bot to make the wrong move.

Rewind and repeat. Hope you good luck!
analyst74
Major
 
Posts: 39
Joined: Wed Feb 17, 2010 7:45 pm


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest

cron