909e8419c7f8d67a41ce2c69e072779478edae5d — Matthew Jorgensen 3 months ago c0cec2e
Normalized line endings.
3 files changed, 91 insertions(+), 91 deletions(-)

M PlayGames/Program.cs
M RockPaperScissors/RockPaperScissors.cs
M ScrabbleScore/Scrabble.cs
M PlayGames/Program.cs => PlayGames/Program.cs +19 -19
@@ 1,14 1,14 @@ using System;
  using ScrabbleScore;
- using RockPaperScissors;
- using System.Linq;
- 
+ using RockPaperScissors;
+ using System.Linq;
+ 
  namespace PlayGames
  {
      class Program
      {
-         static void _Scrabble()
-         {
+         static void _Scrabble()
+         {
              while (true)
              {
                  Console.WriteLine("Enter a word:");


@@ 17,33 17,33 @@ var score = Scrabble.GetScore(inputString);
  
                  Console.WriteLine($"Your score: {score}");
-             }
+             }
          }
  
-         static void _RockPaperScissors()
-         {
-             while (true)
-             {
-                 RPS.PlayGame();
+         static void _RockPaperScissors()
+         {
+             while (true)
+             {
+                 RPS.PlayGame();
              }
          }
  
-         static void Main(string[] args)
-         {
+         static void Main(string[] args)
+         {
              Console.WriteLine("1: ScrabbleScore");
              Console.WriteLine("2: RockPaperScissors");
              Console.WriteLine("Enter your choice.");
              int choice = Convert.ToInt16(Console.ReadLine());
  
-             switch (choice)
-             {
+             switch (choice)
+             {
                  case 1:
                      _Scrabble();
-                     break;
+                     break;
                  case 2:
                      _RockPaperScissors();
-                     break;
-             }
+                     break;
+             }
          }
-     }
+     }
  }= 
\ No newline at end of file

M RockPaperScissors/RockPaperScissors.cs => RockPaperScissors/RockPaperScissors.cs +49 -49
@@ 1,7 1,7 @@ using System;
- using System.Collections.Generic;
- using System.Linq;
- 
+ using System.Collections.Generic;
+ using System.Linq;
+ 
  namespace RockPaperScissors
  {
      public class RPS


@@ 14,95 14,95 @@ return getrandom.Next(0, 3);
              }
          }
-         public static string OpponentChoice(int seed)
-         {
+         public static string OpponentChoice(int seed)
+         {
              var what = new Dictionary<int, string>
-             {
-                 { 0, "rock" },
-                 { 1, "paper" },
-                 { 2, "scissors" }
+             {
+                 { 0, "rock" },
+                 { 1, "paper" },
+                 { 2, "scissors" }
              };
              return what[seed];
- 
+ 
          }
-         public static string UserChoice()
-         {
+         public static string UserChoice()
+         {
              var _options = new[] { "rock", "paper", "scissors" };
              Console.WriteLine("Make a decision (rock, paper, scissors):");
              var userChoice = Console.ReadLine();
-             if (!_options.Contains(userChoice))
-             {
+             if (!_options.Contains(userChoice))
+             {
                  Console.WriteLine("Input not found. You lose.");
-                 System.Environment.Exit(1);
+                 System.Environment.Exit(1);
              }
-             return userChoice;
+             return userChoice;
          }
-         public static string ScoreGame(string opponentChoice, string userChoice)
-         {
+         public static string ScoreGame(string opponentChoice, string userChoice)
+         {
              IDictionary<string, Dictionary<string, string>> _matrix = new Dictionary<string, Dictionary<string, string>>
-             {
+             {
                  {
                      "rock",
-                     new Dictionary<string, string> {
-                         { "rock", "tie" },
-                         { "paper", "lose" },
-                         { "scissors", "win" }
+                     new Dictionary<string, string> {
+                         { "rock", "tie" },
+                         { "paper", "lose" },
+                         { "scissors", "win" }
                      }
                  },
                  {
                      "paper",
-                     new Dictionary<string, string> {
+                     new Dictionary<string, string> {
                          { "rock", "win" },
                          { "paper", "tie" },
-                         { "scissors", "lose" }
+                         { "scissors", "lose" }
                      }
                  },
                  {
                      "scissors",
-                     new Dictionary<string, string> {
+                     new Dictionary<string, string> {
                          { "rock", "lose" },
                          { "paper", "win" },
-                         { "scissors", "tie" }
-                     }
-                 }
+                         { "scissors", "tie" }
+                     }
+                 }
              };
              var result = _matrix[userChoice][opponentChoice];
-             return result;
+             return result;
          }
-         public static void PlayGame()
-         {
+         public static void PlayGame()
+         {
              var userScore = 0;
              var opponentScore = 0;
-             while ((userScore < 3) && (opponentScore < 3))
+             while ((userScore < 3) && (opponentScore < 3))
              {
                  var _opponentChoice = OpponentChoice(Randoms());
                  var _userChoice = UserChoice();
  
                  var result = ScoreGame(_opponentChoice, _userChoice);
-                 switch (result)
-                 {
+                 switch (result)
+                 {
                      case "win":
                          Console.WriteLine("You win!");
                          userScore += 1;
-                         break;
+                         break;
                      case "tie":
                          Console.WriteLine("We tied...");
-                         break;
+                         break;
                      case "lose":
                          Console.WriteLine("You lose!");
                          opponentScore += 1;
-                         break;
- 
-                 }
+                         break;
+ 
+                 }
+             }
+             if (userScore > opponentScore)
+             {
+                 Console.WriteLine("You won!");
+             }
+             else
+             {
+                 Console.WriteLine("I won!");
              }
-             if (userScore > opponentScore)
-             {
-                 Console.WriteLine("You won!");
-             }
-             else
-             {
-                 Console.WriteLine("I won!");
-             }
-         }
+         }
      }
  }

M ScrabbleScore/Scrabble.cs => ScrabbleScore/Scrabble.cs +23 -23
@@ 1,6 1,6 @@ using System;
- using System.Collections.Generic;
- 
+ using System.Collections.Generic;
+ 
  namespace ScrabbleScore
  {
      public static class Scrabble


@@ 11,34 11,34 @@ if (string.IsNullOrEmpty(inputString))
              {
                  return 0;
-             }
- 
-             // Convert the scring into an array of letters.
+             }
+ 
+             // Convert the scring into an array of letters.
              List<char> source = new List<char>();
              source.AddRange(inputString);
  
              // Setup the score dictionary.
-             IDictionary<int, string> letterScore =
-                 new Dictionary<int, string>
-                 {
-                     { 1, "eaiontlsu" },
-                     { 2, "dg" },
-                     { 4, "fhvwy" },
-                     { 5, "k" },
-                     { 8, "jx" },
-                     { 10, "qz" }
+             IDictionary<int, string> letterScore =
+                 new Dictionary<int, string>
+                 {
+                     { 1, "eaiontlsu" },
+                     { 2, "dg" },
+                     { 4, "fhvwy" },
+                     { 5, "k" },
+                     { 8, "jx" },
+                     { 10, "qz" }
                  };
  
              int score = 0;
-             foreach (char c in source)
-             {
-                 foreach (KeyValuePair<int, string> keyValuePair in letterScore)
-                 {
-                     if (keyValuePair.Value.Contains(c))
-                     {
-                         score += keyValuePair.Key;
-                     }
- 
+             foreach (char c in source)
+             {
+                 foreach (KeyValuePair<int, string> keyValuePair in letterScore)
+                 {
+                     if (keyValuePair.Value.Contains(c))
+                     {
+                         score += keyValuePair.Key;
+                     }
+ 
                  }
              }
              return score;