Exemple #1
0
        public static void Main()
        {
            Console.WriteLine("Enter your scrabble word.");
            string        scrabbleWord = Console.ReadLine();
            ScrabbleScore wordScore    = new ScrabbleScore(scrabbleWord);
            int           score        = wordScore.ScoreCalculator();

            Console.WriteLine("Your scrabble word score is " + score);
        }
        static void Main()
        {
            Console.WriteLine("Enter your word");
            string userWord = Console.ReadLine();

            Console.WriteLine(userWord);
            ScrabbleScore word = new ScrabbleScore(userWord);

            word.wordScore();
            Console.WriteLine(word.wordScore());
        }
        public static void Main()
        {
            Console.WriteLine("Give me a word and I will tell you its Scrabble score!");

            string word = Console.ReadLine();

            if (!Regex.IsMatch(word, @"^[a-zA-Z]+$"))
            {
                Console.WriteLine("ERROR: Must give one word in English characters.");
                return;
            }

            ScrabbleScore scrabble = new ScrabbleScore(word);

            Console.WriteLine("-------------------------");
            Console.WriteLine("The word '" + word + "' scores you " + scrabble.GetScore() + " points!");
        }
Exemple #4
0
 public void Lowercase_letter()
 {
     Assert.Equal(1, ScrabbleScore.Score("a"));
 }
Exemple #5
0
 public void Entire_alphabet_available()
 {
     Assert.Equal(87, ScrabbleScore.Score("abcdefghijklmnopqrstuvwxyz"));
 }
Exemple #6
0
 public void Empty_input()
 {
     Assert.Equal(0, ScrabbleScore.Score(""));
 }
Exemple #7
0
 public void English_like_word()
 {
     Assert.Equal(8, ScrabbleScore.Score("pinata"));
 }
Exemple #8
0
 public void Long_mixed_case_word()
 {
     Assert.Equal(41, ScrabbleScore.Score("OxyphenButazone"));
 }
Exemple #9
0
 public void Medium_valuable_word()
 {
     Assert.Equal(22, ScrabbleScore.Score("quirky"));
 }
Exemple #10
0
 public void Medium_word()
 {
     Assert.Equal(6, ScrabbleScore.Score("street"));
 }
Exemple #11
0
 public void Short_valuable_word()
 {
     Assert.Equal(12, ScrabbleScore.Score("zoo"));
 }
Exemple #12
0
 public void Short_word()
 {
     Assert.Equal(2, ScrabbleScore.Score("at"));
 }
Exemple #13
0
 public void Valuable_letter()
 {
     Assert.Equal(4, ScrabbleScore.Score("f"));
 }
Exemple #14
0
 public void Uppercase_letter()
 {
     Assert.Equal(1, ScrabbleScore.Score("A"));
 }