C# pain (anyone have an idea where to learn what a static is?)

Question:it syas the aray i put is not valid becuase the aray i put is to small any one know what to do?


Repl link:https://replit.com/@Josephyc/ticktactoe#main.cs

static public bool ceackforablock(bool[,] inputaray)
    {
        bool[,] isblockedaray = { { false, false, false }, { false, false, false }, { false, false, false } };
        bool isbloked = false;
        int x = -1;
        int y =  0;
        int isthisthefirstone = 0;
        if (isthisthefirstone == 0)
        {
            foreach (bool input in inputaray)
            {
                bool isyesinputturn = false;
                if (x == 2)
                {
                    y++;
                    x = -1;
                }
                if (x > 3)
                {
                    x++;
                }
                if(y == 3){
                  y=0;
                }
                if (input)
                {
                    isblockedaray[x, y] = true;
                    isyesinputturn = true;
                }
                if (!(input) && (isyesinputturn = false))
                {
                    isblockedaray[x, y] = false;
                    isyesinputturn = false;
                }
                isyesinputturn = false;
            }
        }
      if (isthisthefirstone > 0)
        {
            foreach (bool input2 in inputaray)
            {
                if (x == 2)
                {
                    y++;
                    x = -1;
                }
                if (x > 3)
                {
                    x++;
                }
                if(y == 2){
                  y=0;
                }
              if (input2 == true && isblockedaray[x, y] == true)
                {
                    return isbloked = true;

                }
              if ((input2 == false && isblockedaray[x, y] == true) || (input2 == true && isblockedaray[x, y] == false))
                {
                    return isbloked = false;
                  
                }
            }
        }
      return isbloked;
    }

Please don’t keep posting “C# pain” in your title. A concise question will suffice. If you don’t like the language, there are plenty of other options.

This will help you … I hope

https://stackoverflow.com/questions/4124102/whats-a-static-method-in-c

3 Likes