Member 13457548 Ответов: 2

Как я могу закодировать игру scramble на C#


Описание проблемы:
The type or namespace name 'Game' could not be found (are you missing a using directive or an assembly reference?)


Что я уже пробовал:

Я попробовал создать класс в новом файле
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.IO;

namespace random_words
{
    class Program
    {
        static void Main(string[] args)
        {

            Game = new Game(@"Words.txt");//here is where the error is at..pls help! syntax error.
            Console.WriteLine(game.currentWord);
            bool flag = true;
            while (flag) 
            {
                Console.Write("New word:");
                string newWord = Console.ReadLine();
                game.CheckNewWord(newWord);
                Console.WriteLine("Current Score is {0}", game.Score);
                Console.WriteLine("Total is {0}", game.Total);
                Console.Write("Continue (yes or no) ?: "); string ans = Console.ReadLine();
                if (ans.Equals("no")) flag = false;



            }
        }
    }

2 Ответов

Рейтинг:
2

________________

Game game = new Game(@"Words.txt");//fixed


Рейтинг:
1

CPallini

Ну, сообщение об ошибке понятно: нет никакого класса Game определение доступно в вашем коде, поэтому компилятор не знает, что делать.