- Timestamp:
- 10/01/13 16:39:35 (11 years ago)
- Location:
- branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Event Methods/Events/EmptyEvent.cs
r10011 r10014 48 48 49 49 public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) { 50 return ";";50 return string.Empty; 51 51 } 52 52 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Stat.cs
r10011 r10014 43 43 protected Stat(Stat original, Cloner cloner) : base(original, cloner) { } 44 44 45 public Stat() : base("Statement", "A statement.") { } 45 public Stat() 46 : base("Statement", "A statement.") { 47 Suffix = ";"; 48 } 46 49 47 50 public override IDeepCloneable Clone(Cloner cloner) { … … 50 53 51 54 public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) { 52 return children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees))) ;55 return children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees))) + Suffix; 53 56 } 54 57 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/ElseStat.cs
r10011 r10014 44 44 45 45 public ElseStat() 46 : base("ElseStat ement", "An ElseStatement.") {47 Prefix = " else";48 Suffix = " ";46 : base("ElseStat", "An else branch.") { 47 Prefix = " else {"; 48 Suffix = "}"; 49 49 } 50 50 … … 55 55 public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) { 56 56 string result = children.Aggregate(string.Empty, (current, c) => current + (Environment.NewLine + ((CodeNode)c.Symbol).Interpret(c, c.Subtrees))); 57 return string.IsNullOrEmpty(result) 58 ? string.Empty 59 : Prefix + Environment.NewLine + result + Environment.NewLine + Suffix; 57 return string.IsNullOrEmpty(result) ? string.Empty : Prefix + Environment.NewLine + result + Environment.NewLine + Suffix; 60 58 } 61 59 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/IfStat.cs
r10011 r10014 43 43 44 44 public IfStat() 45 : base("IfStat ement", "An if statement.") {45 : base("IfStat", "An if statement.") { 46 46 Prefix = "if ("; 47 Suffix = ") ";47 Suffix = ") {"; 48 48 } 49 49 … … 63 63 else throw new ArgumentException("Unexpected children.", "children"); 64 64 } 65 return Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine + ifElse + Environment.NewLine; 65 string result = Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine + "}"; 66 result += string.IsNullOrEmpty(ifElse) ? Environment.NewLine : ifElse; 67 return result; 66 68 } 67 69 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Statements/WhileStat.cs
r10011 r10014 45 45 : base("WhileStat", "A while statement.") { 46 46 Prefix = "while ("; 47 Suffix = ") ";47 Suffix = ") {"; 48 48 } 49 49 … … 61 61 else throw new ArgumentException("Unexpected children.", "children"); 62 62 } 63 return Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine ;63 return Prefix + condition + Suffix + Environment.NewLine + ifTrue + Environment.NewLine + "}" + Environment.NewLine; 64 64 } 65 65 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Ahead.cs
r10011 r10014 44 44 : base("Ahead", "Immediately moves your robot ahead (forward) by distance measured in pixels.") { 45 45 Prefix = "setAhead("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Back.cs
r10011 r10014 44 44 : base("Back", "Immediately moves your robot backward by distance measured in pixels.") { 45 45 Prefix = "setBack("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/DoNothing.cs
r10011 r10014 48 48 49 49 public override string Interpret(ISymbolicExpressionTreeNode node, IEnumerable<ISymbolicExpressionTreeNode> children) { 50 return ";";50 return string.Empty; 51 51 } 52 52 } -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/Fire.cs
r10011 r10014 44 44 : base("Fire", "Immediately fires a bullet.") { 45 45 Prefix = "setFire("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunLeft.cs
r10011 r10014 44 44 : base("TurnGunLeft", "Immediately turns the robot's gun to the left by degrees.") { 45 45 Prefix = "setTurnGunLeft("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnGunRight.cs
r10011 r10014 44 44 : base("TurnGunRight", "Immediately turns the robot's gun to the right by degrees.") { 45 45 Prefix = "setTurnGunRight("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnLeft.cs
r10011 r10014 44 44 : base("TurnLeft", "Immediately turns the robot's body to the left by degrees.") { 45 45 Prefix = "setTurnLeft("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarLeft.cs
r10011 r10014 44 44 : base("TurnRadarLeft", "Immediately turns the robot's radar to the left by degrees.") { 45 45 Prefix = "setTurnRadarLeft("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRadarRight.cs
r10011 r10014 44 44 : base("TurnRadarRight", "Immediately turns the robot's radar to the right by degrees.") { 45 45 Prefix = "setTurnRadarRight("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48 -
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/3.3/Symbols/Void Methods/TurnRight.cs
r10011 r10014 44 44 : base("TurnRight", "Immediately turns the robot's body to the right by degrees.") { 45 45 Prefix = "setTurnRight("; 46 Suffix = ") ;";46 Suffix = ")"; 47 47 } 48 48
Note: See TracChangeset
for help on using the changeset viewer.