Thread: C++ Simple Puzzle Word Game

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    1

    Thumbs up C++ Simple Puzzle Word Game

    Here is my code
    I want to calculate the point score by the user. For example for each puzzle word would get 1 point if the puzzle word is correct. And Display the total score

    like this (lppea= apple) 1 point.
    sorry for my bad English.
    Code:
    #include<iostream>
    #include<string>
    using namespace std;
    int main()
    {
    	const int a=3;
    	string word[a]={"apple","ball","cat"};
    	string nword[a]={"lppea","lalb","cta"};
    	string j;
    	int point;
    	int p=0;
    	int ctr=0;
    
    	
    	cout<<"BASIC"<<endl;
    	for(int i=0; i<a; i++)
    	{
    		cout<<nword[i]<<endl;
    		cin>>j;
    		
    		 
    	
    		ctr++;
    		if(j==word[i])
    		{
    			cout<<"==========Congratulation========="<<endl;
    			cout<<"==========You Have Score:"<<endl;
    			cout<<"       "<<i+1<<" "<<"Point"<<endl;
    			 
    		}
    		else
    		{
    			cout<<"Wrong"<<endl;
    		}
    		
    	}
    	//cout<<"Your Score Is:"<<point<<endl;
    	return 0;
    }
    Last edited by ijAcK; 09-23-2008 at 09:56 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need help using arrays ( simple hangman game)
    By skymoha in forum C Programming
    Replies: 2
    Last Post: 03-04-2009, 04:52 AM
  2. Replies: 7
    Last Post: 06-16-2006, 09:23 PM
  3. Simple driving game
    By VirtualAce in forum Game Programming
    Replies: 6
    Last Post: 07-06-2004, 09:34 AM
  4. Im a Newbie with a graphics design problem for my simple game
    By Robert_Ingleby in forum C++ Programming
    Replies: 1
    Last Post: 11-23-2001, 06:41 PM
  5. Whats a very simple but good game i can try to make?
    By bluehead in forum C++ Programming
    Replies: 2
    Last Post: 11-06-2001, 09:24 PM