7 Replies - 7122 Views - Last Post: 24 November 2012 - 03:41 AM Rate Topic: -----

#1 darkzod   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 23-November 12

I'm trying to build a word guessing program

Posted 23 November 2012 - 11:54 AM

Hello everybody,

First my English is not so good. I'm learning English since September. Next year I'll start with highschool programming.
I've an English vocabulary list in notepad. Using this tutorial I have a lot of information extracted.
http://www.dreaminco...-guessing-game/
I'll make a word guessing program. First I declare a random and a string array with vocabulary (see the code below)the random shows the string array into the label. I have one Textbox and button.

What I want to do is: If I the answer type in the textboxt and it's correct with the question label can go to next word.


For example: Label random: "Where is Japan" | Answer: Asia| Textbox User type in: Asia go to next question.


Who can help me?

Thanks

namespace QuizeForm
{
    public partial class Form2 : Form
    {
        Random r = new Random();
        string[] strlabel = { "What is Ability: ", "What is Skills:", "What is Description: ", "What is Experience:",   "What is District:", "What is Main:", "What is Reason:", "What is conversation:", "What is Spend:", "What is Twice:", "What is Urgent:" };
        
        public Form2()
        {            
            InitializeComponent();
            int iSelect = r.Next(0, 10);
            lblQuestion.Text = strlabel[iSelect];
        }
        
       private void btnNext_Click(object sender, EventArgs e)
       {

           int iSelect = r.Next(0, 10);
           lblQuestion.Text = strlabel[iSelect];
          
       }


    }
}

This post has been edited by tlhIn`toq: 23 November 2012 - 02:41 PM
Reason for edit:: fixed link


Is This A Good Question/Topic? 0
  • +

Replies To: I'm trying to build a word guessing program

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6536
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: I'm trying to build a word guessing program

Posted 23 November 2012 - 12:03 PM

SO what you're really asking is: Would someone design my application logic for me? Is that right?

There is a link in my signature block to an article on "homework help". That should help you do your planning BEFORE you start typing. There is even an example of building a multiple choice question application in that article.








My standard beginner resources post


We have a tutorials section and a learning C# series of articles.

First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover. Do a couple hundred on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.

There are three routes people seem to take when learning programming.
  • Just start trying to create programs
  • Start taking apart other programs and try to figure out the language by reverse engineering
  • Follow a guided learning course (school or self-teaching books)


For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.


If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Oct 2012
Spoiler

This post has been edited by tlhIn`toq: 23 November 2012 - 12:04 PM

Was This Post Helpful? 0
  • +
  • -

#3 darkzod   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 23-November 12

Re: I'm trying to build a word guessing program

Posted 23 November 2012 - 02:08 PM

Thanks for your answer. My program is all ready designed by me. And this is no homework. I need only help with if question equal answer give messagebox

Thanks

This post has been edited by tlhIn`toq: 23 November 2012 - 02:25 PM
Reason for edit:: No need to quote the entire previous message: We all see it

Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6536
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: I'm trying to build a word guessing program

Posted 23 November 2012 - 02:26 PM

So your question is "How do I check if two strings are the same?" - Is that right?

personally I always drop both sides of the check to lower case just to be safe.

if (stringOne.ToLower() == stringTwo.ToLower())
{
   // Then do something since they match
}

Was This Post Helpful? 0
  • +
  • -

#5 darkzod   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 23-November 12

Re: I'm trying to build a word guessing program

Posted 23 November 2012 - 04:45 PM

I think it's diffecult to explain. I drew a plan on paint, you are nearly by my question. Before I have had tried this code it was good job:
if (question8 == "D")
            {
                Console.WriteLine("Correct answer");
                Console.WriteLine(" ");
                Console.WriteLine(" What is the meaning Home?");
                Console.WriteLine("A:Huis  B:Adil C:Ev  D:Nur ");
                goto cevap9;


But I will now try string arraylist. I hope someone can understand my Drawing.

http://imageshack.us...6/arraylist.png

Thanks a lot tlhIn for your time.


View PosttlhIn`toq, on 23 November 2012 - 02:26 PM, said:

So your question is "How do I check if two strings are the same?" - Is that right?

personally I always drop both sides of the check to lower case just to be safe.

if (stringOne.ToLower() == stringTwo.ToLower())
{
   // Then do something since they match
}

This post has been edited by tlhIn`toq: 23 November 2012 - 06:35 PM
Reason for edit:: Fixed link

Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6536
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: I'm trying to build a word guessing program

Posted 23 November 2012 - 06:38 PM

In the future please include your images in the post.

Attached Image



Also, don't wrap your links in code tags. That stops them from being links. Just type out the address.
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6536
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: I'm trying to build a word guessing program

Posted 23 November 2012 - 06:44 PM

I understand what you are trying to build: A quiz program where the player can type A, B, C, D to select an answer.

I tried to tell you before to read this tutorial:

There is a full explanation of how you SHOULD try to build a quiz program. The way you are doing it is very very hard and not a good way. An ArrayList is not a good choice for this project. You are not the first rookie to ask about how to build a quiz program - That's why I made the tutorial.

Attached Image
Was This Post Helpful? 0
  • +
  • -

#8 darkzod   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 23-November 12

Re: I'm trying to build a word guessing program

Posted 24 November 2012 - 03:41 AM

tlhIn thanks a lot I'll read your tutorial. And thanks for the comments



View PosttlhIn`toq, on 23 November 2012 - 06:44 PM, said:

I understand what you are trying to build: A quiz program where the player can type A, B, C, D to select an answer.

I tried to tell you before to read this tutorial:

There is a full explanation of how you SHOULD try to build a quiz program. The way you are doing it is very very hard and not a good way. An ArrayList is not a good choice for this project. You are not the first rookie to ask about how to build a quiz program - That's why I made the tutorial.

Attachment temp2.jpg

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1