Untitled

 avatar
unknown
csharp
5 months ago
5.1 kB
8
Indexable
if (Input[i][j] == 'A')
                    {
                        
                        if (i >= 1 && (Input[i].Length - 1) - j >= 1)
                        {
                            if (Input[i - 1][j + 1] == 'S')
                            {
                                if ((Input.Count - 1) - i >= 1 && (Input[i].Length - 1) - j >= 1)
                                {
                                    if (Input[i + 1][j + 1] == 'S')
                                    {
                                        if ((Input.Count - 1) - i >= 1 && j >= 1)
                                        {
                                            if (Input[i + 1][j - 1] == 'M')
                                            {
                                                if (i >= 1 && j >= 1)
                                                {
                                                    if (Input[i - 1][j - 1] == 'M')
                                                    {
                                                        masCount++;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                            if (Input[i - 1][j + 1] == 'S')
                            {
                                if ((Input.Count - 1) - i >= 1 && (Input[i].Length - 1) - j >= 1)
                                {
                                    if (Input[i + 1][j + 1] == 'M')
                                    {
                                        if ((Input.Count - 1) - i >= 1 && j >= 1)
                                        {
                                            if (Input[i + 1][j - 1] == 'M')
                                            {
                                                if (i >= 1 && j >= 1)
                                                {
                                                    if (Input[i - 1][j - 1] == 'S')
                                                    {
                                                        masCount++;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                            if (Input[i - 1][j + 1] == 'M')
                            {
                                if ((Input.Count - 1) - i >= 1 && (Input[i].Length - 1) - j >= 1)
                                {
                                    if (Input[i + 1][j + 1] == 'M')
                                    {
                                        if ((Input.Count - 1) - i >= 1 && j >= 1)
                                        {
                                            if (Input[i + 1][j - 1] == 'S')
                                            {
                                                if (i >= 1 && j >= 1)
                                                {
                                                    if (Input[i - 1][j - 1] == 'S')
                                                    {
                                                        masCount++;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                            if (Input[i - 1][j + 1] == 'M')
                            {
                                if ((Input.Count - 1) - i >= 1 && (Input[i].Length - 1) - j >= 1)
                                {
                                    if (Input[i + 1][j + 1] == 'S')
                                    {
                                        if ((Input.Count - 1) - i >= 1 && j >= 1)
                                        {
                                            if (Input[i + 1][j - 1] == 'S')
                                            {
                                                if (i >= 1 && j >= 1)
                                                {
                                                    if (Input[i - 1][j - 1] == 'M')
                                                    {
                                                        masCount++;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
Editor is loading...
Leave a Comment