Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs	(revision 10014)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Grammar.cs	(revision 10028)
@@ -57,6 +57,5 @@
       var block = new Block();
       var stat = new Stat();
-      var ifStat = new IfStat();
-      var elseStat = new ElseStat();
+      var ifThenElseStat = new IfThenElseStat();
       var whileStat = new WhileStat();
 
@@ -122,5 +121,5 @@
 
       #region Symbol Collections
-      var controlSymbols = new ISymbol[] { ifStat, whileStat };
+      var controlSymbols = new ISymbol[] { ifThenElseStat, whileStat };
       var actionSymbols = new ISymbol[] {
         ahead, back, fire, turnGunLeft, turnGunRight, turnLeft, turnRadarLeft, turnRadarRight, turnRight
@@ -132,5 +131,5 @@
 
       var events = new GroupSymbol(EventsName, new ISymbol[] { onScannedRobot, onBulletHit, onBulletMissed, onHitByBullet, onHitRobot, onHitWall });
-      var controlStatements = new GroupSymbol(ControlStatementsName, controlSymbols.Concat(new[] { elseStat }));
+      var controlStatements = new GroupSymbol(ControlStatementsName, controlSymbols);
       var expressions = new GroupSymbol(ExpressionsName, new ISymbol[] { logicalExpr, numericalExpr });
       var robocodeFunctions = new GroupSymbol(RobocodeFunctionsName, actionSymbols.Concat(functionSymbols));
@@ -193,16 +192,11 @@
 
       // IfStat
-      AddAllowedChildSymbol(ifStat, logicalExpr, 0);
-      AddAllowedChildSymbol(ifStat, stat, 1);
-      AddAllowedChildSymbol(ifStat, emptyEvent, 1);
-      AddAllowedChildSymbol(ifStat, doNothing, 1);
-      AddAllowedChildSymbol(ifStat, elseStat, 2);
-      AddAllowedChildSymbol(ifStat, emptyEvent, 2);
-      AddAllowedChildSymbol(ifStat, doNothing, 2);
-
-      // ElseStat
-      AddAllowedChildSymbol(elseStat, stat);
-      AddAllowedChildSymbol(elseStat, emptyEvent);
-      AddAllowedChildSymbol(elseStat, doNothing);
+      AddAllowedChildSymbol(ifThenElseStat, logicalExpr, 0);
+      AddAllowedChildSymbol(ifThenElseStat, stat, 1);
+      AddAllowedChildSymbol(ifThenElseStat, emptyEvent, 1);
+      AddAllowedChildSymbol(ifThenElseStat, doNothing, 1);
+      AddAllowedChildSymbol(ifThenElseStat, stat, 2);
+      AddAllowedChildSymbol(ifThenElseStat, emptyEvent, 2);
+      AddAllowedChildSymbol(ifThenElseStat, doNothing, 2);
 
       // WhileStat
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj	(revision 10014)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/HeuristicLab.Problems.Robocode-3.3.csproj	(revision 10028)
@@ -116,6 +116,5 @@
     <Compile Include="Symbols\Void Methods\Back.cs" />
     <Compile Include="Symbols\Block.cs" />
-    <Compile Include="Symbols\Statements\ElseStat.cs" />
-    <Compile Include="Symbols\Statements\IfStat.cs" />
+    <Compile Include="Symbols\Statements\IfThenElseStat.cs" />
     <Compile Include="Symbols\Statements\WhileStat.cs" />
     <Compile Include="Symbols\Logical Expressions\BooleanTreeNode.cs" />
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/ElseStat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/ElseStat.cs	(revision 10014)
+++ 	(revision )
@@ -1,60 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class ElseStat : CodeNode {
-    public override int MinimumArity { get { return 1; } }
-    public override int MaximumArity { get { return 1; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    protected ElseStat(bool deserializing) : base(deserializing) { }
-    protected ElseStat(ElseStat original, Cloner cloner) : base(original, cloner) { }
-
-    public ElseStat()
-      : base("ElseStat", "An else branch.") {
-      Prefix = " else {";
-      Suffix = "}";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new ElseStat(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees)));
-      return string.IsNullOrEmpty(result) ? string.Empty : Prefix + Environment.NewLine + result + Environment.NewLine + Suffix;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfStat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfStat.cs	(revision 10014)
+++ 	(revision )
@@ -1,70 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.Robocode {
-  [StorableClass]
-  public class IfStat : CodeNode {
-    public override int MinimumArity { get { return 2; } }
-    public override int MaximumArity { get { return 3; } }
-
-    [Storable]
-    public override string Prefix { get; set; }
-
-    [Storable]
-    public override string Suffix { get; set; }
-
-    [StorableConstructor]
-    protected IfStat(bool deserializing) : base(deserializing) { }
-    protected IfStat(IfStat original, Cloner cloner) : base(original, cloner) { }
-
-    public IfStat()
-      : base("IfStat", "An if statement.") {
-      Prefix = "if (";
-      Suffix = ") {";
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new IfStat(this, cloner);
-    }
-
-    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
-      string condition = string.Empty, ifTrue = string.Empty, ifElse = string.Empty;
-      foreach (var c in children) {
-        if (c.Symbol is LogicalExpression)
-          condition = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-        else if (c.Symbol is Stat)
-          ifTrue = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-        else if (c.Symbol is ElseStat || c.Symbol is EmptyEvent || c.Symbol is DoNothing)
-          ifElse = ((CodeNode)c.Symbol).Interpret(c, c.Subtrees);
-        else throw new ArgumentException("Unexpected children.", "children");
-      }
-      string result = Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine + "}";
-      result += string.IsNullOrEmpty(ifElse) ? Environment.NewLine : ifElse;
-      return result;
-    }
-  }
-}
Index: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfThenElseStat.cs
===================================================================
--- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfThenElseStat.cs	(revision 10028)
+++ branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfThenElseStat.cs	(revision 10028)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Robocode {
+  [StorableClass]
+  public class IfThenElseStat : CodeNode {
+    public override int MinimumArity { get { return 2; } }
+    public override int MaximumArity { get { return 3; } }
+
+    [Storable]
+    public override string Prefix { get; set; }
+
+    [Storable]
+    public override string Suffix { get; set; }
+
+    [StorableConstructor]
+    protected IfThenElseStat(bool deserializing) : base(deserializing) { }
+    protected IfThenElseStat(IfThenElseStat original, Cloner cloner) : base(original, cloner) { }
+
+    public IfThenElseStat() : base("IfThenElseStat", "An if statement.") { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IfThenElseStat(this, cloner);
+    }
+
+    public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) {
+      ISymbolicExpressionTreeNode condition = null, truePart = null, falsePart = null;
+      var enumerator = children.GetEnumerator();
+      int childCount = 0;
+      while (enumerator.MoveNext()) {
+        childCount++;
+        switch (childCount) {
+          case 1: condition = enumerator.Current; break;
+          case 2: truePart = enumerator.Current; break;
+          case 3: falsePart = enumerator.Current; break;
+          default: throw new ArgumentException("Unexpected number of children. Expected a maximum of 3 children.");
+        }
+      }
+      if (childCount < 2) throw new ArgumentException("Unexpected number of children. Expected at least 2 children.");
+
+      var parts = new[] {
+        ((CodeNode)condition.Symbol).Interpret(condition, condition.Subtrees),
+        ((CodeNode)truePart.Symbol).Interpret(truePart, truePart.Subtrees),
+        ((CodeNode)falsePart.Symbol).Interpret(falsePart, falsePart.Subtrees)
+      };
+
+      string result = "if (" + parts[0] + ") {" + parts[1] + "}";
+      if (!string.IsNullOrEmpty(parts[2]))
+        result += " else {" + result[2] + "}";
+      return result;
+    }
+  }
+}
