Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. i asked to explain this code, but i think i prefer a mental hospital . not a single description about what he done

i asked to explain this code, but i think i prefer a mental hospital . not a single description about what he done

Scheduled Pinned Locked Moved The Weird and The Wonderful
12 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kdgupta87
    wrote on last edited by
    #1

    void show()
    {
    int man=5;
    string action = string.Empty;
    for (int j = 1; j < indx-1;j++ )
    {
    for (int k = 1; k < indy-1; k++)
    {
    Console.Write(arr[j,k]+ " ");
    int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
    int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
    int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
    int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
    int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
    int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
    int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
    int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
    if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
    {
    action = string.Empty;
    }
    else {//q=w=e
    if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
    //q=w=e=a=d
    if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
    {
    //q=w=e=a=d=z=x
    if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
    {
    action = "c";
    }
    else
    { // q=w=e=a=d=z
    if (arr[j - 1, k] == arr[j + 1, k - 1])
    {
    //x=c
    if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
    else//x!=c
    { action = "x"; }
    }

                                    else
                                    { //q=w=e=a=d!=z
                                        if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                        { //x=c
                                            if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
    
    A R _ K T 6 Replies Last reply
    0
    • K kdgupta87

      void show()
      {
      int man=5;
      string action = string.Empty;
      for (int j = 1; j < indx-1;j++ )
      {
      for (int k = 1; k < indy-1; k++)
      {
      Console.Write(arr[j,k]+ " ");
      int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
      int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
      int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
      int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
      int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
      int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
      int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
      int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
      if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
      {
      action = string.Empty;
      }
      else {//q=w=e
      if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
      //q=w=e=a=d
      if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
      {
      //q=w=e=a=d=z=x
      if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
      {
      action = "c";
      }
      else
      { // q=w=e=a=d=z
      if (arr[j - 1, k] == arr[j + 1, k - 1])
      {
      //x=c
      if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
      else//x!=c
      { action = "x"; }
      }

                                      else
                                      { //q=w=e=a=d!=z
                                          if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                          { //x=c
                                              if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
      
      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      I have no idea either, but the letters listed ("qweadzxc") are arranged on the keyboard as a square. That makes me think it's related to video game controls.

      [WikiLeaks Cablegate Cables]

      K C 2 Replies Last reply
      0
      • A AspDotNetDev

        I have no idea either, but the letters listed ("qweadzxc") are arranged on the keyboard as a square. That makes me think it's related to video game controls.

        [WikiLeaks Cablegate Cables]

        K Offline
        K Offline
        kdgupta87
        wrote on last edited by
        #3

        good guess, it is something on image analysis my job is use pointer instead of array, can u understand my pain X| X| . :( :( :( :( :(

        1 Reply Last reply
        0
        • K kdgupta87

          void show()
          {
          int man=5;
          string action = string.Empty;
          for (int j = 1; j < indx-1;j++ )
          {
          for (int k = 1; k < indy-1; k++)
          {
          Console.Write(arr[j,k]+ " ");
          int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
          int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
          int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
          int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
          int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
          int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
          int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
          int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
          if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
          {
          action = string.Empty;
          }
          else {//q=w=e
          if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
          //q=w=e=a=d
          if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
          {
          //q=w=e=a=d=z=x
          if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
          {
          action = "c";
          }
          else
          { // q=w=e=a=d=z
          if (arr[j - 1, k] == arr[j + 1, k - 1])
          {
          //x=c
          if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
          else//x!=c
          { action = "x"; }
          }

                                          else
                                          { //q=w=e=a=d!=z
                                              if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                              { //x=c
                                                  if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
          
          R Offline
          R Offline
          RobCroll
          wrote on last edited by
          #4

          There are plenty of comments.

          //q=w=e!a!d

          ;) There's no doubt the companies intellectual property is safe hand there. They have even obfuscated 5 to equal man.

          "You get that on the big jobs."

          K 1 Reply Last reply
          0
          • R RobCroll

            There are plenty of comments.

            //q=w=e!a!d

            ;) There's no doubt the companies intellectual property is safe hand there. They have even obfuscated 5 to equal man.

            "You get that on the big jobs."

            K Offline
            K Offline
            kdgupta87
            wrote on last edited by
            #5

            need comments for these comments

            1 Reply Last reply
            0
            • A AspDotNetDev

              I have no idea either, but the letters listed ("qweadzxc") are arranged on the keyboard as a square. That makes me think it's related to video game controls.

              [WikiLeaks Cablegate Cables]

              C Offline
              C Offline
              Chris Meech
              wrote on last edited by
              #6

              AspDotNetDev wrote:

              it's related to video game controls.

              But only for left handed ones. :)

              Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

              A 1 Reply Last reply
              0
              • K kdgupta87

                void show()
                {
                int man=5;
                string action = string.Empty;
                for (int j = 1; j < indx-1;j++ )
                {
                for (int k = 1; k < indy-1; k++)
                {
                Console.Write(arr[j,k]+ " ");
                int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
                int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
                int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
                int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
                int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
                int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
                int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
                int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
                if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
                {
                action = string.Empty;
                }
                else {//q=w=e
                if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
                //q=w=e=a=d
                if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
                {
                //q=w=e=a=d=z=x
                if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
                {
                action = "c";
                }
                else
                { // q=w=e=a=d=z
                if (arr[j - 1, k] == arr[j + 1, k - 1])
                {
                //x=c
                if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
                else//x!=c
                { action = "x"; }
                }

                                                else
                                                { //q=w=e=a=d!=z
                                                    if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                                    { //x=c
                                                        if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
                
                _ Offline
                _ Offline
                _Erik_
                wrote on last edited by
                #7

                I would prefer to learn chinese rather than trying to understand this mess.

                P 1 Reply Last reply
                0
                • _ _Erik_

                  I would prefer to learn chinese rather than trying to understand this mess.

                  P Offline
                  P Offline
                  phil o
                  wrote on last edited by
                  #8

                  So we're all waiting for your brand new article written in Chinese ;)

                  1 Reply Last reply
                  0
                  • K kdgupta87

                    void show()
                    {
                    int man=5;
                    string action = string.Empty;
                    for (int j = 1; j < indx-1;j++ )
                    {
                    for (int k = 1; k < indy-1; k++)
                    {
                    Console.Write(arr[j,k]+ " ");
                    int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
                    int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
                    int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
                    int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
                    int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
                    int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
                    int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
                    int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
                    if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
                    {
                    action = string.Empty;
                    }
                    else {//q=w=e
                    if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
                    //q=w=e=a=d
                    if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
                    {
                    //q=w=e=a=d=z=x
                    if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
                    {
                    action = "c";
                    }
                    else
                    { // q=w=e=a=d=z
                    if (arr[j - 1, k] == arr[j + 1, k - 1])
                    {
                    //x=c
                    if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
                    else//x!=c
                    { action = "x"; }
                    }

                                                    else
                                                    { //q=w=e=a=d!=z
                                                        if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                                        { //x=c
                                                            if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
                    
                    K Offline
                    K Offline
                    Keith Badeau
                    wrote on last edited by
                    #9

                    This guy should work for the government--he seems to be an expert on ciphers and cryptography!

                    1 Reply Last reply
                    0
                    • K kdgupta87

                      void show()
                      {
                      int man=5;
                      string action = string.Empty;
                      for (int j = 1; j < indx-1;j++ )
                      {
                      for (int k = 1; k < indy-1; k++)
                      {
                      Console.Write(arr[j,k]+ " ");
                      int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
                      int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
                      int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
                      int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
                      int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
                      int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
                      int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
                      int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
                      if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
                      {
                      action = string.Empty;
                      }
                      else {//q=w=e
                      if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
                      //q=w=e=a=d
                      if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
                      {
                      //q=w=e=a=d=z=x
                      if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
                      {
                      action = "c";
                      }
                      else
                      { // q=w=e=a=d=z
                      if (arr[j - 1, k] == arr[j + 1, k - 1])
                      {
                      //x=c
                      if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
                      else//x!=c
                      { action = "x"; }
                      }

                                                      else
                                                      { //q=w=e=a=d!=z
                                                          if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                                          { //x=c
                                                              if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
                      
                      T Offline
                      T Offline
                      TorstenH
                      wrote on last edited by
                      #10

                      There is a App key for that -> "Delete" I tried to modify an equal code some weeks ago. As I got behind it, I figured out it didn't make much sense at all. regards Torsten

                      I never finish anyth...

                      1 Reply Last reply
                      0
                      • C Chris Meech

                        AspDotNetDev wrote:

                        it's related to video game controls.

                        But only for left handed ones. :)

                        Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

                        A Offline
                        A Offline
                        Asday
                        wrote on last edited by
                        #11

                        Nah, all vidya nowadays has your right hand on the mouse, and your left hand on WASD. Hell, even full keyboard RTS games like StarCraft II do, apart from the occasional N or L hit.

                        1 Reply Last reply
                        0
                        • K kdgupta87

                          void show()
                          {
                          int man=5;
                          string action = string.Empty;
                          for (int j = 1; j < indx-1;j++ )
                          {
                          for (int k = 1; k < indy-1; k++)
                          {
                          Console.Write(arr[j,k]+ " ");
                          int q = Math.Abs(arr[j - 1, k - 1] - arr[j, k]);
                          int w = Math.Abs(arr[j - 1, k] - arr[j, k]);
                          int e = Math.Abs(arr[j -1, k +1] - arr[j, k]);
                          int a = Math.Abs(arr[j , k - 1] - arr[j, k]);
                          int d = Math.Abs(arr[j, k + 1] - arr[j, k]);
                          int z = Math.Abs(arr[j + 1, k - 1] - arr[j, k]);
                          int x = Math.Abs(arr[j + 1, k ] - arr[j, k]);
                          int c = Math.Abs(arr[j + 1, k +1] - arr[j, k]);
                          if (q < man && w < man && e < man && a < man && d < man && z < man && x < man && c < man)
                          {
                          action = string.Empty;
                          }
                          else {//q=w=e
                          if (arr[j - 1, k - 1] == arr[j - 1, k] && arr[j - 1, k] == arr[j + 1, k + 1]) {
                          //q=w=e=a=d
                          if (arr[j - 1, k] == arr[j, k - 1] && arr[j, k - 1] == arr[j - 1, k])
                          {
                          //q=w=e=a=d=z=x
                          if (arr[j - 1, k] == arr[j + 1, k - 1] && arr[j, k - 1] == arr[j + 1, k])
                          {
                          action = "c";
                          }
                          else
                          { // q=w=e=a=d=z
                          if (arr[j - 1, k] == arr[j + 1, k - 1])
                          {
                          //x=c
                          if (arr[j + 1, k] == arr[j + 1, k + 1]) { action = "xc"; }
                          else//x!=c
                          { action = "x"; }
                          }

                                                          else
                                                          { //q=w=e=a=d!=z
                                                              if (arr\[j + 1, k - 1\] == arr\[j + 1, k + 1\])
                                                              { //x=c
                                                                  if (arr\[j + 1, k\] == arr\[j + 1, k + 1\]) { action = "zxc"; }
                          
                          B Offline
                          B Offline
                          BillW33
                          wrote on last edited by
                          #12

                          I used to work with people who liked to write code like that. Why add comments, they just slow down the rate at which such fine code can be written. ;) That is one of the reasons I left that job. :-D

                          Just because the code works, it doesn't mean that it is good code.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups