Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Problem description:
The type or namespace name 'Game' could not be found (are you missing a using directive or an assembly reference?)


What I have tried:

I Tried generating class in new file
C#
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;



            }
        }
    }
Posted
Updated 17-Dec-17 21:19pm
v2

Well, the error message is clear: there is no class Game definition available in your code, so the compiler doesn't know what to do.
 
Share this answer
 
Game game = new Game(@"Words.txt");//fixed
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900