Click here to Skip to main content
15,891,567 members
Home / Discussions / C#
   

C#

 
QuestionFTP Problem Pin
Kevin Marois16-Jun-11 9:07
professionalKevin Marois16-Jun-11 9:07 
AnswerRe: FTP Problem [modified] Pin
Matt Meyer16-Jun-11 10:22
Matt Meyer16-Jun-11 10:22 
GeneralRe: FTP Problem Pin
Kevin Marois16-Jun-11 12:15
professionalKevin Marois16-Jun-11 12:15 
GeneralRe: FTP Problem Pin
Matt Meyer16-Jun-11 13:10
Matt Meyer16-Jun-11 13:10 
GeneralRe: FTP Problem Pin
Kevin Marois16-Jun-11 13:20
professionalKevin Marois16-Jun-11 13:20 
QuestionReverse (2-way) synchronization: DataGridView to Table (Database) Pin
Paladin200016-Jun-11 3:49
Paladin200016-Jun-11 3:49 
GeneralRe: Reverse (2-way) synchronization: DataGridView to Table (Database) Pin
Paladin200016-Jun-11 5:09
Paladin200016-Jun-11 5:09 
Questionhelp optimize functions Pin
Abbath134916-Jun-11 1:33
Abbath134916-Jun-11 1:33 
Can u help me optimize this functions? There are labels array5*5.
if Label[i,j] has symbol then IsEmpty[i,j] has false if it hasn't IsEmpty[i,j] is true;
Funcktions for game Royal Square )

public bool IsOpenForLetter(bool[,] IsEmpty, int x, int y)
       {
           int imin, imax, jmin, jmax;
           int xSize = IsEmpty.GetLength(0);
           int ySize = IsEmpty.GetLength(1);
           if (IsEmpty[x, y])
           {
               if (x > 0) imin = x - 1;
               else imin = x;
               if (y > 0) jmin = y - 1;
               else jmin = y;
               if (x < xSize - 1) imax = x + 1;
               else imax = x;
               if (y < ySize - 1) jmax = y + 1;
               else jmax = y;

               for (int i = imin; i <= imax; i++)
                   for (int j = jmin; j <= jmax; j++)
                       if (!IsEmpty[i, j])
                           return true;
           }
           return false;
       }


       public bool IsItNear(int fx, int fy, int sx, int sy, bool[,] IsEmpty)
       {
           bool[,] Action = new bool[3, 3];
           for (int i = 0; i < 3; i++)
               for (int j = 0; j < 3; j++)
                   Action[i, j] = true;
           int ftx, fty, sdx, sdy;
           ftx = fx; fty = fy; sdx = sx; sdy = sy;
           if (sdx == 0)
               for (int i = 0; i < 3; i++)
                   Action[0, i] = false;
           if (sdy == 0)
               for (int i = 0; i < 3; i++)
                   Action[i, 0] = false;
           if (sdx == 4)
               for (int i = 0; i < 3; i++)
                   Action[2, i] = false;
           if (sdy == 4)
               for (int i = 0; i < 3; i++)
                   Action[i, 2] = false;
           Action[1, 1] = false;
           sdx--; sdy--;
           for (int i = 0; i < 3; i++)
           {
               for (int j = 0; j < 3; j++)
               {
                   if (Action[i, j] == true)
                      if (IsEmpty[sdx, sdy] == false)
                           if (sdx == ftx && sdy == fty)
                               return true;
                   sdy++;
               }
               sdx++; sdy=sy-1;
           }
                   return false;
       }

GeneralRe: help optimize functions Pin
Paladin200016-Jun-11 3:18
Paladin200016-Jun-11 3:18 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 3:30
Abbath134916-Jun-11 3:30 
GeneralRe: help optimize functions Pin
Paladin200016-Jun-11 3:54
Paladin200016-Jun-11 3:54 
GeneralRe: help optimize functions Pin
V.16-Jun-11 3:55
professionalV.16-Jun-11 3:55 
GeneralRe: help optimize functions Pin
Paladin200016-Jun-11 4:12
Paladin200016-Jun-11 4:12 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 4:48
Abbath134916-Jun-11 4:48 
AnswerRe: help optimize functions Pin
V.16-Jun-11 3:55
professionalV.16-Jun-11 3:55 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 4:12
BobJanova16-Jun-11 4:12 
GeneralRe: help optimize functions Pin
V.16-Jun-11 5:43
professionalV.16-Jun-11 5:43 
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 10:17
mentorNot Active16-Jun-11 10:17 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 10:29
BobJanova16-Jun-11 10:29 
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 11:56
mentorNot Active16-Jun-11 11:56 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 22:55
BobJanova16-Jun-11 22:55 
GeneralRe: help optimize functions Pin
PIEBALDconsult16-Jun-11 15:52
mvePIEBALDconsult16-Jun-11 15:52 
AnswerRe: help optimize functions Pin
Pete O'Hanlon16-Jun-11 4:30
mvePete O'Hanlon16-Jun-11 4:30 
AnswerRe: help optimize functions Pin
David198716-Jun-11 4:40
David198716-Jun-11 4:40 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 6:34
Abbath134916-Jun-11 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.