namespace HeuristicLab.BenchmarkSuite.Problems { public class Checksum : BenchmarkSuiteDataDescriptor { private const string name = "Checksum"; private const string fileName = "Checksum.csv"; private const string description = "Given a string, convert each character in the string into its integer ASCII value, sum them, take the sum modulo 64, add the integer value of the space character, and then convert that integer back into its corresponding character(the checksum character). The program must print Check sum is X, where X is replaced by the correct checksum character."; protected override string FileName { get { return fileName; } } public override string Name { get { return name; } } public override string Description { get { return description; } } protected override int InputArgumentCount { get { return 1; } } protected override int OutputArgumentCount { get { return 1; } } public override ProblemData CreateProblemData() { return new ProblemData { Name = Name, Description = Description, Examples = CloneExamples(), BestResult = 0, WorstResult = char.MaxValue, InputArgumentTypes = new[] { ExampleArgumentType.String }, OutputArgumentTypes = new[] { ExampleArgumentType.Char }, TrainingCount = 100, TestCount = 1000, EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String, MaxSize = 800, EvalLimit = 1500, ErcOptions = { ErcProbability = 0.05, IntegerErcOptions = { IsEnabled = true, Constants = new [] { 64 }, Start = -128, End = 128 }, CharErcOptions = { IsEnabled = true, Constants = new [] { ' ' }, Start = 0x20, End = 0x7e } } }; } protected override Example ParseExample(string[] input, string[] output) { return new Example { InputArgs = input, OutputArgs = output, InputString = input, OutputChar = output[0].ToCharArray(), }; } } }