예제 #1
0
        private string ButtonGameRows(RandomizeButtonGame bg)           // format button game instructions
        {
            StringBuilder ButtonGamesb      = new StringBuilder();
            string        ButtonGameHeading = "Button Game \n\n";
            string        ButtonGameHead    = "{LED} -> {Release on digit}\n";

            ButtonGamesb.Append(ButtonGameHeading);
            ButtonGamesb.Append(ButtonGameHead);

            for (int i = 0; i < colors.Length; i++)
            {
                string currentColor     = Converter.CharToStr(colors[i]);
                int    currentTimeValue = bg.TimeValues[i];

                ButtonGamesb.Append($"{currentColor} Color -> {currentTimeValue} \n");
            }

            return(ButtonGamesb.ToString());
        }
예제 #2
0
        private string SimonSaysGameRows(RandomizeSimonSaysGame ssg)
        {
            StringBuilder SimonSaysGamesb      = new StringBuilder();
            string        SimonSaysGameHeading = "Simon Says Game \n\n";
            string        SimonSaysGameHead    = "{Blinking LED} -> {Button to press}\n";

            SimonSaysGamesb.Append(SimonSaysGameHeading);
            SimonSaysGamesb.Append(SimonSaysGameHead);

            for (int i = 0; i < ssg.Nums.Count; i++)
            {
                string currentLED    = Converter.CharToStr(colors[i]);
                string currentButton = Converter.CharToStr(colors[ssg.Nums[i]]);

                SimonSaysGamesb.Append($"{currentLED} LED -> {currentButton} Button\n");
            }

            SimonSaysGamesb.Append(String.Join(",", ssg.Sequence));

            return(SimonSaysGamesb.ToString());
        }