コード例 #1
0
        private static void PrintRepresentation(int intToRep, string intRepresentation)
        {
            if (intRepresentation.Length == 1)
            {
                Console.WriteLine($"The smallest representation of {intToRep} in Brainfuck is {intRepresentation.Length} character:");
            }
            else
            {
                Console.WriteLine($"The smallest representation of {intToRep} in Brainfuck is {intRepresentation.Length} characters:");
            }

            Console.WriteLine(intRepresentation);

            int cellOffset = IntRepresentation.CellOffset(intRepresentation);

            if (cellOffset == 1)
            {
                Console.WriteLine($"The result will be offset from the pointer by {cellOffset} cell.");
            }
            else
            {
                Console.WriteLine($"The result will be offset from the pointer by {cellOffset} cells.");
            }
        }
コード例 #2
0
 private static string FindIntRepresentation(int intToRep)
 {
     return(IntRepresentation.FindIntRepresentation(intToRep));
 }