Making multiple if / else statements?

this code checks a word input against the list “words” . … but how do I add multiple different if statements one rite after the other, so user must get 10 code words correct ? each correct word will allow user to next code word, and until he reaches action will be taken , door to player opens etc whatever… this code works with one check the “words” list I have more statements needed

so when user inputs correct code an action is taken but what if I wanted to add another set of code after the first code word, so multiple code words . each word checked from different lists if player types correct 1st word it then goes to the 2nd list and checks for the next typed input word,

so for example
I have 10 lists each test with different code words

and after the 1st correct word is typed user then must input the next codeword and then the next etc
so
10 lists to pull from and so 10 codewords

I thought about pasting the code after that code in same script since its in the same input field box but I think its wiser to just add more if /else statements

correct?

	using System.Collections.Generic;
	using UnityEngine;
	using UnityEngine.UI;
	using System.IO;

	public class werda :  MonoBehaviour
	{
		public GameObject inputField;
		public string wordsFile;

		private HashSet<string> hash;

		void Start()
		{
		wordsFile = "C:\\Users\

ew\Pictures\words2.txt";
//wordsFile = Application.dataPath + “/words2.txt”;
inputField = GameObject.Find(“InputField”); //This is where you assign the input field object so you can access your inputField component
inputField.GetComponent ().text = “”; //This makes it so the input field starts with nothing in it.

			string[] array = File.ReadAllLines// This will load a text file into an array of strings
			Debug.Log("entries in array: " array.Length);

			hash = new HashSet < > (array); // this converts the string array to a HashSet, could also use a dictionary for slightly better speed
			Debug.Log("entries in hash: " hash.Count);
		}

		void Update()
		{
			if (Input.GetKeyDown(KeyCode.))
			{
				string input = inputField.GetComponent < > ().text; // set a string to be what they entered
				Debug.Log("checking word: "input);

				if (hash.Contains()) // check if the HashSet contains the code they entered 
				{
					Debug.Log("word found");
					// If they get here the code is correct magic door opens
					// i.e its in the list of 60,000 words
					// do SOMETHING
				} else {
					//Debug.Log("word NOT found");
				Destroy (gameObject, 1 );
					// IF they get here... then they entered a WRONG CODe , magic door closes
					// i.e not in the list of 60k words
					// DO SOMETHING
				}
			}
		}
	}

I do not understand what you mean when you say that you have 10 lists. You have a single HashSet

private HashSet<string> hash;

Do you want to use just the hash defined or will you have multiple ones (10 of them)?

Here is how you can achive what you want easily just by using the single HashSet

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.IO;

public class werda : MonoBehaviour
{
    public InputField inputField; // set this as an InputField not a GameObject
    public string wordsFile;

    // this will allow you to change the number of correct inputs needed (mainly for testing/debugging)
    [Range(1, 20)]
    public int correctEntriesRequired = 10; // default to 10

    private HashSet<string> hash;
    private int currentWord = 0;

    void Start()
    {
        wordsFile = "C:\\Users\

ew\Pictures\words2.txt"; // this location should be changed to a folder at the root of the drive
string array = File.ReadAllLines( wordsFile ); // This will load a text file into an array of strings
Debug.Log("entries in array: " + array.Length);

        hash = new HashSet<string>(array); // this converts the string array to a HashSet, could also use a dictionary for slightly better speed
        Debug.Log("entries in hash: " + hash.Count);

        // the preferred method is to set the inputField in the inspector, but if it wasn't
        if ((inputField == null) &&          // if the inputField was not set in the inspector (preferred) then try and find it
            (GameObject.Find("InputField"))) // if there is an InputField game object that can be found
        {
            inputField = GameObject.Find("InputField").GetComponent <InputField>(); //This is where you assign the input field object so you can access your inputField component
        }

        if (inputField != null)
        {
            inputField.text = "";
            // the following adds a listener to the inputField for when the user has finished editing
            // instead of using the update method - more efficient
		    inputField.onEndEdit.AddListener(delegate{LockInput(inputField);});
        }
    }

	// Checks if there is anything entered into the input field.
	void LockInput(InputField input)
	{
		if (input.text.Length > 0) 
		{
            if (hash.Contains(input.text)) // check if the HashSet contains the code they entered 
            {
			    currentWord++;
                input.text = "";
                if (currentWord >= correctEntriesRequired)
                {
                    // all entries were correct now do something - for example
                    AllCodewordsCorrect();
                }
            }
            else
            {
                // do something if not correct - for example
                currentWord = 0; // force restart
                // Destroy(gameObject, 1); // magic door closes - remove object
            }
		}
		else if (input.text.Length == 0) 
		{
			Debug.Log("Main Input Empty");
		}
    }

	void AllCodewordsCorrect()
	{
        // do something here after all entered code words are deemed valid
	}
}