Please help with Gann Square of Nine Grid - page 2

 
deVries:

I tested the code of Tasleem it is working

Could you please attach the indicator which works with you
 

turkm:
check this version of the indicator nowwww it works very fine thanks to all of you.

Nice editing.
 
turkm:

Could you please attach the indicator which works with you
 
deVries:


Its work very well now, but why i cant get the coordinates of element when i look for it in array, if you have a moment please take a look to your version which i made some changes with it at these function:

void search(double num)
{  
   
   int num_1=number_1 / point;
   for(int x_1=0; x_1<=n; x_1++)
   {
      for(int y_1=0; y_1<=n; y_1++)
      {
         if (a[x_1][y_1] == (number_1 / point))
         {
            array_x=x_1;
            array_y=y_1;
            
            //break;break;break;
         }
      }
   }
   Comment(array_x,"     ",array_y,"   ",number_1 / point,"    ",num_1);
}
Files:
 

here is the program with the change

don't search for double value if you still have integers in the array

in journal experts you will read the value if n is chosen not too big you can check easily if the function is working correctly

void SearchRoutine(int number)
  {
   int i, j,x,y;    
   for (i = n; i >= 0; i--)
     {
      j = 0;
      for (j = n; j >= 0; j--)
        {
         if(a[i][j] ==  number)
            {
             y=i;x=j;i=0;j=0;//y vertical row x horizontal col y
             Print("a[",x,"][",y,"] = ",number);
            }
        } 
     }   
   return;
  } 
Files:
 
deVries:

here is the program with the change

don't search for double value if you still have integers in the array

in journal experts you will read the value if n is chosen not too big you can check easily if the function is working correctly

thank you very much, its helping me a lot.
 

There is more to improve

counting row && colom from zero to n-1 with n=1 only 1 row 1 colom

n=2 2 row 2 colom max fill 4

change Gann()

void Gann()
{
   int row, col, r, c, fill=0, m=1;
   //Centre point
   row = n/2; col=row;
   //Clockwise Spiral Begin
   fill++; a[row][col]=fill;      
   //move left
   fill++; col--; a[row][col] = fill;
   while((m<=n)&&(fill<n*n)){      
      m += 2;
      //move up
     for(r=1; r<=(m-2); r++){if(fill<n*n){fill++; row--; a[row][col]= fill;}}     
     //move right 
     for(c=1; c<=(m-1); c++){if(fill<n*n){fill++; col++; a[row][col]= fill;}}     
      //move down
     for(r=1; r<=(m-1); r++){if(fill<n*n){fill++; row++; a[row][col]= fill;}}     
     //move left
     for(c=1; c<=m; c++){if(fill<n*n){fill++; col--; a[row][col]=fill;}}
   }     
}

Files:
 
deVries:

There is more to improve

counting row && colom from zero to n-1 with n=1 only 1 row 1 colom

n=2 2 row 2 colom max fill 4

change Gann()


Really many thanks, its works fine.
 
how is this stuff use turkm. i mean the squareu ninel. is it a trad indicator?
Reason: