Commits

Alexander Regueiro committed 86e16d4

Added PoSh script to build tarball for contest entry.

Comments (0)

Files changed (6)

built-tarball.ps1

+# Builds tarball for contest entry.
+$entryTarPath = "bin/entry.tar"
+$entryTarGzPath = "bin/entry.tar.gz"
+rm $entryTarPath
+rm $entryTarGzPath
+& 7za a $entryTarPath install run src/ bin/
+& 7za a $entryTarGzPath $entryTarPath

foo.txt

-1
-get
-0
-1
-get
-0
-1
-get
-0
-#!/bin/sh
-
-exit 0
+#!/bin/sh
+
+exit 0
Binary file added.
-#!/bin/sh
-
-./bin/Icfp2011.Icrs.Player.exe ./bin/Icfp2011.Icrs.RandomBot.dll $@
+#!/bin/sh
+
+mono "./bin/Icfp2011.Icrs.Player.exe ./bin/Icfp2011.Icrs.RandomBot.dll $@"

src/Icfp2011.Icrs.Player/Program.cs

 
                 if (args.Length < 2)
                 {
+#if DEBUG
                     Console.Error.WriteLine(Properties.Settings.Default.MessageNotEnoughArgs);
+#endif
                     return Properties.Settings.Default.ExitCodeNotEnoughArgs;
                 }
 
         {
             var match = new LtgMatch();
 
+#if DEBUG
             Console.Error.WriteLine("I am player {0}.", player);
+#endif
 
             playerBot.Start();
             if (player != match.CurrentPlayer)
 
         private static void DoProponentAction(LtgMatch match)
         {
-            DoAction(match, playerBot.DoAction());
+            var action = playerBot.DoAction();
+            WriteCardAction(action);
+            DoAction(match, action);
         }
 
         private static void DoOpponentAction(LtgMatch match)
         {
             if (action.Card == null)
             {
+#if DEBUG
                 Console.Error.WriteLine("{0}: invalid card", match.CurrentPlayer);
+#endif
                 return;
             }
 
             LtgException result;
             slot.DoAction(propSlots, oppSlots, action, out result);
 
+#if DEBUG
             Console.Error.WriteLine("{0}: {1} {2} {3}", match.CurrentPlayer,
                 action.ApplyOrder, action.Card.ToName(), action.SlotIndex);
+#endif
         }
 
         private static void WriteCardAction(LtgAction action)