[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/bbcode.php on line 112: 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#] Fatal Error @testing

It is currently Wed Apr 25, 2018 7:58 pm Advanced search

[C#] Fatal Error @testing

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

[C#] Fatal Error @testing

Postby ramvanderlinden » Tue Feb 09, 2010 11:08 pm

I get a fatal error when testing through cmd in C# (Win XP).
I ensured that csc (c# compiler) works properly (as in: 'csc MyTronBot.cs' works just fine).

script:
==========================================
cd "C:\...\TronBot\cs"
java -jar engine/Tron.jar maps/u.txt "csc MyTronBot.cs" "java -jar example_bots/RandomBot.jar"
pause
==========================================

FATAL ERROR: failed to write to stream: java.io.IOException: De pipes worden gesloten (english: the pipes are being closed)
java.lang.Exception: One of the programs crashed!
Player Two Wins!

Additional info:
-two basic bots vs eachother work fine.
-problem seems independent of my own code. (When running the code beneath, the same error is produced)

public static void Main() {
while (true)
{
Map.Initialize();
Map.MakeMove("East");
} }

Any ideas?
ramvanderlinden
Cadet
 
Posts: 4
Joined: Tue Feb 09, 2010 8:47 am

Re: [C#] Fatal Error @testing

Postby dutchflyboy » Tue Feb 09, 2010 11:24 pm

You should first compile the c# program with csc, and then use the resulting .exe file in your command:
cd "C:\...\TronBot\cs"
csc MyTronBot.cs
java -jar engine/Tron.jar maps/u.txt "MyTronBot.exe" "java -jar example_bots/RandomBot.jar"
pause
dutchflyboy
Colonel
 
Posts: 57
Joined: Sun Feb 07, 2010 1:08 am

Re: [C#] Fatal Error @testing

Postby ohmusama » Wed Feb 10, 2010 8:03 am

Same issue with default package.

This is the issue I get with using csc over gmcs at compile time. gmcs throws only warnings with the basic package.

Syntax error: illegal atomic form

()

Expansion history:

<syntax> (begin (public static string MakeMove () (int x
= Map.MyX () int y = Map.MyY () List<string> validMo......
<syntax> (public static string MakeMove () (int x = Map.M
yX () int y = Map.MyY () List<string> validMoves = new... <--

*** Shell command terminated with exit status 1: /usr/bin/chicken MyTronBot.cs -
output-file MyTronBot.c -quiet
ohmusama
Cadet
 
Posts: 3
Joined: Sun Feb 07, 2010 6:08 pm

Re: [C#] Fatal Error @testing

Postby ramvanderlinden » Wed Feb 10, 2010 9:03 am

ramvanderlinden
Cadet
 
Posts: 4
Joined: Tue Feb 09, 2010 8:47 am

Re: [C#] Fatal Error @testing

Postby ramvanderlinden » Wed Feb 10, 2010 10:04 am

Ok I fixed my problem now. The batch mentioned above does not do the trick. Reading the 'Getting Started -> Compiling and Running your own code' again did though.

How to fix this:
-Create a new C# project (for instance in the free Microsoft Visual C# Express Edition)
-Add MyTronBot.cs and Map.cs to the project.
-Remove Game1 and Program from the project.
-build
-Go fetch the executable from the project/bin/x86/release (or debug) folder
-Name it MyTronBot.exe
-Put the exe in your starters-pack tronbot folder (so the cs folder in the C# case).
-put this in a new .cmd file:
==========================
cd C:\the\path\to\my\cs\folder
java -jar engine/Tron.jar maps/u.txt "MyTronBot.exe" "java -jar example_bots/RandomBot.jar"
pause
==========================
-run


So the real problem was that I didn't create a project but tried to compile a single file (where Map.cs was needed in the namespace).
Good luck!
ramvanderlinden
Cadet
 
Posts: 4
Joined: Tue Feb 09, 2010 8:47 am

Re: [C#] Fatal Error @testing

Postby dutchflyboy » Wed Feb 10, 2010 11:46 am

I've just looked it up, you can also compile multiple files using csc:

cd "C:\...\TronBot\cs"
csc /t:exe /out:MyTronBot.exe /recurse:*.cs
java -jar engine/Tron.jar maps/u.txt "MyTronBot.exe" "java -jar example_bots/RandomBot.jar"

That will compile all C# files in the folder.
dutchflyboy
Colonel
 
Posts: 57
Joined: Sun Feb 07, 2010 1:08 am


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest

cron