war crimes in programming - A thread to discuss and share horrifying programming ideas/code

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
The biggest war crime ever committed in programming is the invention of JavaScript. Brendan Eich is permanently hiding in the USA to avoid getting extradited to The Hague so that he can face trial and die in custody awaiting his next hearing like Milosevic did. Having said that: the entire team GNOME development team proliferating JavaScript outside of a web browser deserve to be beaten with an oar until they're unconscious and transported by black ops agents to The Hague to face trial for their crimes against humanity and technology.
unpopular opinion, but javascript is far from the worst programming language out there. i think its main problem is the absolute retards that use it. is it a clunky piece of shit? yes. has the standard become an incomprehensible behemoth over the years? yes. is html5 (js's homeland) an abomination? yes.
despite all that, i think the mere act of using javascript isn't really much of a war crime. it's more like being a disgusting hoarder that lives in filth and squalor. the war crimes only come when npm and electron and all the other bullshit you are conditioned to expect when you hear "javascript" come out.
afaik, gnome's use of javascript (while rather fucked up) is nowhere near as bad as the average electron webshit. iiuc they seem to be using it as a scripting/extension language in the same way many other projects use python, instead of bringing in the whole web browser stack just to render a tiny widget *cough* windows 11 *cough*.
 
Pajeet contractor, wrote a django app for something, every function was structured like this
Python:
def saar(bobs, and_, vagene):
    try:
        # ............
        try:
            # ........
        except Exception:
            print("An error occurred")
            return None
        # .........
    except Exception:
        print("An error occurred")
        return None
the try within a try is making me laugh and horrified at the same time
 
unpopular opinion, but javascript is far from the worst programming language out there. i think its main problem is the absolute retards that use it. is it a clunky piece of shit? yes. has the standard become an incomprehensible behemoth over the years? yes. is html5 (js's homeland) an abomination? yes.
despite all that, i think the mere act of using javascript isn't really much of a war crime. it's more like being a disgusting hoarder that lives in filth and squalor. the war crimes only come when npm and electron and all the other bullshit you are conditioned to expect when you hear "javascript" come out.
afaik, gnome's use of javascript (while rather fucked up) is nowhere near as bad as the average electron webshit. iiuc they seem to be using it as a scripting/extension language in the same way many other projects use python, instead of bringing in the whole web browser stack just to render a tiny widget *cough* windows 11 *cough*.
I agree with what you're saying, but here's a thought - would it be the same situation if browsers used something else? JavaScript attracts the biggest midwits around by being easy but just obfuscated enough to make the user feel smart when he makes the monkey dance. It's a symbiotic relationship.

If Brendan Eich had sat down and wrote a real language without all the hard stuff papered and spackled over in a weekend, would webdev still be a 150MB webpack piece of shit?
 
I agree with what you're saying, but here's a thought - would it be the same situation if browsers used something else?
99% chance because webdevs are fucking retarded
JavaScript attracts the biggest midwits around by being easy but just obfuscated enough to make the user feel smart when he makes the monkey dance. It's a symbiotic relationship.
If Brendan Eich had sat down and wrote a real language without all the hard stuff papered and spackled over in a weekend, would webdev still be a 150MB webpack piece of shit?
js is basically a scheme that was neutered hard to remove cons cells and macros and to look like java, so it's actually quite well-based* on proper programming language design principles. the 150MB webpack bullshit mostly comes from a shitty culture that has arised over the years
* propensity for funny type coercion aside
 
99% chance because webdevs are fucking retarded


js is basically a scheme that was neutered hard to remove cons cells and macros and to look like java, so it's actually quite well-based* on proper programming language design principles. the 150MB webpack bullshit mostly comes from a shitty culture that has arised over the years
* propensity for funny type coercion aside
Fair enough on the points of the language.

There's always that guy who just throws JavaScript at everything, never of engineering stock, and swears up and down JavaScript at every level of the stack is the future. I swear if it was Lua in the browser it would be harder for guys like him to have the tools to perpetuate it because of how close the bindings often are to the underlying libraries/binaries. It'd still be pretty forgiving but he wouldn't get it and would fuck off back to marketing to dictate colors of buttons or something.

Maybe I'm missing the forest for the trees that the browser's scripting necessarily has to be easy and we wouldn't have what we have if it wasn't. But there's always that guy, he's always hovering around the engineering team, and he's always a total dumbass.
 
There's always that guy who just throws JavaScript at everything, never of engineering stock, and swears up and down JavaScript at every level of the stack is the future. I swear if it was Lua in the browser it would be harder for guys like him to have the tools to perpetuate it because of how close the bindings often are to the underlying libraries/binaries. It'd still be pretty forgiving but he wouldn't get it and would fuck off back to marketing to dictate colors of buttons or something.
i don't think there are actually any big differences between javascript and lua. lua is a bit simpler but generally they are in the exact same niche
as always the tool isn't necessarily good or bad and what matters is how you use it
javascript just gets a bad rap for being the tool used by the worst craftsmen you've ever seen
 
Pajeet contractor, wrote a django app for something, every function was structured like this
Stuff like that I call "cargo cult programming", people like that don't know themselves why they do this; they just "learned it like that" and are just blindly repeating what they thought they learned, which then gets applied wrongly which they don't know because the fundamental understanding why things work the way they do isn't there. They're basically just reciting the ancient words and hope the gods of programming will gift them with rain. Many such cases.

I saw an ad the other day that stated that thanks to AI, you can become a (well-earning) programmer without knowing how to program.
 
Pajeet contractor, wrote a django app for something, every function was structured like this
Python:
def saar(bobs, and_, vagene):
    try:
        # ............
        try:
            # ........
        except Exception:
            print("An error occurred")
            return None
        # .........
    except Exception:
        print("An error occurred")
        return None
This is your threadly-reminder that try-catch blocks are a performance nightmare and nesting them is twice as niggerlicious. Only lines capable of generating an exception should be in the try block.
 
This is your threadly-reminder that try-catch blocks are a performance nightmare and nesting them is twice as niggerlicious. Only lines capable of generating an exception should be in the try block.
People who use try/catch as part of normal flow like a variable being null or an undefined key make me something something.
 
This is your threadly-reminder that try-catch blocks are a performance nightmare and nesting them is twice as niggerlicious. Only lines capable of generating an exception should be in the try block.
i think the specific performance degradation depends on the language and runtime but python being python i would assume it does some stupid shit
in the general case however, exceptions should be basically 0 overhead until something throws
 
People who use try/catch as part of normal flow like a variable being null or an undefined key make me something something.
People don't realize how disruptive exception handling is at the CPU level, it absolutely smashes the stack up, and in C++, if your RAII isn't on point, you're going to leak a lot of memory just from throw. My favorite way of explaining exception handling is "have you ever thought to yourself, 'god, I wish I was the kernel'?"
 
I think I found this gem randomly while dorking pastebin.
Its... next level I would say.
C++:
#include <stdio.h>
#include <iostream>

using namespace std;


int main()

{
   int tab[8][8][2];
   int a,d,e,f,g,h,i,j,m,n,k,x,y,z;
   int l=0;
   int c=0;
   int c1=0;
   int turno=1;
   int pieza;
   int pieza2;
   char b[10];
   char exit[10];
   char co1[]={"AaBbCcDdEeFfGgHh"};
   char co2[]={"12345678"};
  
  
  
   tab[0][0][0]=4;
   tab[1][0][0]=6;
   tab[2][0][0]=8;
   tab[3][0][0]=10;
   tab[4][0][0]=12;
   tab[5][0][0]=8;
   tab[6][0][0]=6;
   tab[7][0][0]=4;
   tab[0][1][0]=2;
   tab[1][1][0]=2;
   tab[2][1][0]=2;
   tab[3][1][0]=2;
   tab[4][1][0]=2;
   tab[5][1][0]=2;
   tab[6][1][0]=2;
   tab[7][1][0]=2;
   tab[0][7][0]=3;
   tab[1][7][0]=5;
   tab[2][7][0]=7;
   tab[3][7][0]=9;
   tab[4][7][0]=11;
   tab[5][7][0]=7;
   tab[6][7][0]=5;
   tab[7][7][0]=3;
   tab[0][6][0]=1;
   tab[1][6][0]=1;
   tab[2][6][0]=1;
   tab[3][6][0]=1;
   tab[4][6][0]=1;
   tab[5][6][0]=1;
   tab[6][6][0]=1;
   tab[7][6][0]=1;
  
  
  
  
   for(y=2;y<6;++y)
   {
       for(x=0;x<8;++x)
       {
           tab[x][y][0]=0;
       }
   }
  
   do
   {
     c=0;
    
     for(y=0;y<8;++y)
      
   { 
       if (y==0)
       {
           printf("     ");
           while (c<8)
           {
           printf("_______ ");
           c++;
           }
           printf("    ");
           printf("\n");
       }
      
       else{}
      
      
          
  
               for(z=1;z<=5;++z)
              
               {
              
               for(x=0;x<8;++x)
                
                  {
                  
                   if (x==0)
                   {
                       if (z==3)
                       {
                           a=(8-y);
                           printf(" ");
                           printf("%d",a);
                           printf("  |");
                       }
                      
                       else
                           {
                           printf("    |");
                           }
                    }
                   else{}       
                  
                  
                  
                
              
               switch (z)
               {
                   case 1:
                   {   
                  
                   switch (tab[x][y][0])
                   {
                       case 1:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///_///");
                           }
                           else
                           {
                           printf("   _   ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 2:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///_///");
                           }
                           else
                           {
                           printf("   _   ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 3:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//^^^//");
                           }
                           else
                           {
                           printf("  ^^^  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                       case 4:
                       {
                          
                           if ((x+y)%2==0)
                           {
                           printf("//^^^//");
                           }
                           else
                           {
                           printf("  ^^^  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 5:
                       {
                          
                           if ((x+y)%2==0)
                           {
                           printf("//___//");
                           }
                           else
                           {
                           printf("  ___  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                      
                       case 6:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//___//");
                           }
                           else
                           {
                           printf("  ___  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 7:
                       {
                      
                           if ((x+y)%2==0)
                           {
                           printf("///^///");
                           }
                           else
                           {
                           printf("   ^   ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 8:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///^///");
                           }
                           else
                           {
                           printf("   ^   ");
                           }
                        
                           printf("|");
                       if (x==7)
                       {
                       printf("    ");
                       printf("\n");
              
                       }
                          
                       else{}
                           break;
                       }
                      
                      
                       case 9:
                       {
      
                            if ((x+y)%2==0)
                           {
                           printf("//@@@//");
                           }
                           else
                           {
                           printf("  @@@  ");
                           }
                        
                           printf("|");
                          if (x==7)
                       {
                       printf("    ");
                       printf("\n");
              
                       }
                          
                       else{}
                           break;
                          
                       }
                      
                      
                       case 10:
                       {
                            if ((x+y)%2==0)
                           {
                           printf("//@@@//");
                           }
                           else
                           {
                           printf("  @@@  ");
                           }
                        
                           printf("|");
                         if (x==7)
                       {
                       printf("    ");
                       printf("\n");
              
                       }
                          
                       else{}
                           break;
                       }
                      
                      
                       case 11:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//{+}//");
                           }
                           else
                           {
                           printf("  {+}  ");
                           }
                        
                           printf("|");
                         if (x==7)
                       {
                       printf("    ");
                       printf("\n");
              
                       }
                          
                       else{}
                           break;
                       }
                      
                      
                       case 12:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//{+}//");
                           }
                           else
                           {
                           printf("  {+}  ");
                           }
                        
                           printf("|");
                          if (x==7)
                       {
                       printf("    ");
                       printf("\n");
              
                       }
                          
                       else{}
                           break;
                        }
                        
                        default:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///////");
                           }
                           else
                           {
                           printf("       ");
                           }
                          
                           printf("|");
                          if (x==7)
                       {
                        printf("    ");
                        printf("\n");
              
                        }
                          
                           else{}
                           break;
                        }
                      
                   }
                   break;
               }
              
               case 2:
                   {   
                  
                   switch (tab[x][y][0])
                   {
                       case 1:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//(#)//");
                           }
                           else
                           {
                           printf("  (#)  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                            else{}
                            break;
                       }
                      
                      
                       case 2:
                       {
      
                           if ((x+y)%2==0)
                           {
                           printf("//( )//");
                           }
                           else
                           {
                           printf("  ( )  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 3:
                       {
                          if ((x+y)%2==0)
                           {
                           printf("/[###]/");
                           }
                           else
                           {
                           printf(" [###] ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                       case 4:
                       {
                          
                            if ((x+y)%2==0)
                           {
                           printf("/[   ]/");
                           }
                           else
                           {
                           printf(" [   ] ");
                           }
                        
                           printf("|");
                          if (x==7)
                         {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 5:
                       {
                          
                            if ((x+y)%2==0)
                           {
                           printf("|/@#<|/");
                           }
                           else
                           {
                           printf(" /@#<  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                      
                       case 6:
                       {
                          
                            if ((x+y)%2==0)
                           {
                           printf("|/@ <|/");
                           }
                           else
                           {
                           printf(" /@ <  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                         }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 7:
                       {
                      
                           if ((x+y)%2==0)
                           {
                           printf("/<###>/");
                           }
                           else
                           {
                           printf(" <###> ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 8:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("/<   >/");
                           }
                           else
                           {
                           printf(" <   > ");
                           }
                        
                           printf("|");
                       if (x==7)
                       {
                       printf("    ");
                       printf("\n");
              
                       }
                          
                       else{}
                           break;
                       }
                      
                      
                       case 9:
                       {
      
                           if ((x+y)%2==0)
                           {
                           printf("//>#<//");
                           }
                           else
                           {
                           printf("  >#<  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                          
                       }
                      
                      
                       case 10:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//> <//");
                           }
                           else
                           {
                           printf("  > <  ");
                           }
                        
                           printf("|");
                         if (x==7)
                         {
                         printf("    ");
                         printf("\n");
              
                         }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 11:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//>#<//");
                           }
                           else
                           {
                           printf("  >#<  ");
                           }
                        
                           printf("|");
                         if (x==7)
                         {
                         printf("    ");
                         printf("\n");
              
                         }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 12:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//> <//");
                           }
                           else
                           {
                           printf("  > <  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                        }
                        
                        default:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///////");
                           }
                           else
                           {
                           printf("       ");
                           }
                          
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                        }
                        
                   }
                  
                 break;   
               }
              
              
               case 3:
                   {   
                  
                   switch (tab[x][y][0])
                   {
                       case 1:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//}#{//");
                           }
                           else
                           {
                           printf("  }#{  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                            else{}
                            break;
                       }
                      
                      
                       case 2:
                       {
      
                           if ((x+y)%2==0)
                           {
                           printf("//} {//");
                           }
                           else
                           {
                           printf("  } {  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                            }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 3:
                       {
                            if ((x+y)%2==0)
                           {
                           printf("//]#[//");
                           }
                           else
                           {
                           printf("  ]#[  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                            }
                          
                           else{}
                           break;
                       }
                      
                       case 4:
                       {
                            if ((x+y)%2==0)
                           {
                           printf("//] [//");
                           }
                           else
                           {
                           printf("  ] [  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 5:
                       {
                          
                            if ((x+y)%2==0)
                           {
                           printf("/}##/|/");
                           }
                           else
                           {
                           printf(" }##/  ");
                           }
                        
                           printf("|");
                           if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                      
                       case 6:
                       {
                          
                            if ((x+y)%2==0)
                           {
                           printf("/}  /|/");
                           }
                           else
                           {
                           printf(" }  /  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 7:
                       {
                      
                           if ((x+y)%2==0)
                           {
                           printf("//>#<//");
                           }
                           else
                           {
                           printf("  >#<  ");
                           }
                        
                           printf("|");
                           if (x==7)
                          {
                            printf("    ");
                            printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 8:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//> <//");
                           }
                           else
                           {
                           printf("  > <  ");
                           }
                        
                           printf("|");
                       if (x==7)
                        {
                          printf("    ");
                          printf("\n");
              
                        }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 9:
                       {
      
                           if ((x+y)%2==0)
                           {
                           printf("//<#>//");
                           }
                           else
                           {
                           printf("  <#>  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                          
                       }
                      
                      
                       case 10:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("//< >//");
                           }
                           else
                           {
                           printf("  < >  ");
                           }
                        
                           printf("|");
                         if (x==7)
                         {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 11:
                       {
                            if ((x+y)%2==0)
                           {
                           printf("//<#>//");
                           }
                           else
                           {
                           printf("  <#>  ");
                           }
                        
                           printf("|");
                         if (x==7)
                         {
                          printf("    ");
                          printf("\n");
              
                         }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 12:
                       {
                            if ((x+y)%2==0)
                           {
                           printf("//< >//");
                           }
                           else
                           {
                           printf("  < >  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                          }
                          
                           else{}
                           break;
                        }
                        
                        default:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///////");
                           }
                           else
                           {
                           printf("       ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                        }
                   }
                   break;
               }
              
               case 4:
                   {   
                  
                   switch (tab[x][y][0])
                   {
                       case 1:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("/{###}/");
                           }
                           else
                           {
                           printf(" {###} ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                            }
                          
                            else{}
                            break;
                            }
                      
                      
                            case 2:
                           {
      
                           if ((x+y)%2==0)
                           {
                           printf("/{   }/");
                           }
                           else
                           {
                           printf(" {   } ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 3:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("/[###]/");
                           }
                           else
                           {
                           printf(" [###] ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                       case 4:
                       {
                          
                           if ((x+y)%2==0)
                           {
                           printf("/[   ]/");
                           }
                           else
                           {
                           printf(" [   ] ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                          else{}
                           break;
                       }
                      
                      
                       case 5:
                       {
                          
                           if ((x+y)%2==0)
                           {
                           printf("/{##}//");
                           }
                           else
                           {
                           printf(" {##}  ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                      
                       case 6:
                       {
                          
                           if ((x+y)%2==0)
                           {
                           printf("/{  }//");
                           }
                           else
                           {
                           printf(" {  }  ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 7:
                       {
                      
                            if ((x+y)%2==0)
                           {
                           printf("/[###]/");
                           }
                           else
                           {
                           printf(" [###] ");
                           }
                        
                           printf("|");
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 8:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("/[   ]/");
                           }
                           else
                           {
                           printf(" [   ] ");
                           }
                        
                           printf("|");
                       if (x==7)
                       {
                        printf("    ");
                        printf("\n");
              
                       }
                          
                       else{}
                           break;
                       }
                      
                      
                       case 9:
                       {
  
                           if ((x+y)%2==0)
                           {
                           printf("/{###}/");
                           }
                           else
                           {
                           printf(" {###} ");
                           }
                        
                           printf("|");
                          if (x==7)
                       {
                        printf("    ");
                        printf("\n");
              
                        }
                          
                           else{}
                           break;
                          
                       }
                      
                      
                       case 10:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("/{   }/");
                           }
                           else
                           {
                           printf(" {   } ");
                           }
                        
                           printf("|");
                         if (x==7)
                         {
                          printf("    ");
                          printf("\n");
              
                         }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 11:
                       {
                             if ((x+y)%2==0)
                           {
                           printf("/{###}/");
                           }
                           else
                           {
                           printf(" {###} ");
                           }
                        
                           printf("|");
                       if (x==7)
                       {
                        printf("    ");
                        printf("\n");
              
                       }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 12:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("/{   }/");
                           }
                           else
                           {
                           printf(" {   } ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                          }
                          
                           else{}
                           break;
                        }
                        
                        default:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("///////");
                           }
                           else
                           {
                           printf("       ");
                           }
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                          }
                          
                           else{}
                           break;
                        }
                   }
                   break;
               }
              
               case 5:
                   {   
                  
                   switch (tab[x][y][0])
                   {
                       case 1:
                       {
                           printf("_______");
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                           }
                          
                            else{}
                            break;
                       }
                      
                      
                       case 2:
                       {
      
                           printf("_______");
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 3:
                       {
                           printf("_______");
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                            }
                          
                           else{}
                           break;
                       }
                      
                       case 4:
                       {
                          
                           printf("_______");
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 5:
                       {
                          
                           printf("_______");
                        
                           printf("|");
                           if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                      
                       case 6:
                       {
                          
                           printf("_______");
                        
                           printf("|");
                          if (x==7)
                          {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 7:
                       {
                      
                           printf("_______");
                        
                           printf("|");
                           if (x==7)
                          {
                            printf("    ");
                            printf("\n");
              
                          }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 8:
                       {
                           printf("_______");
                        
                           printf("|");
                           if (x==7)
                           {
                            printf("    ");
                            printf("\n");
              
                            }
                          
                           else{}
                      
                           break;
                       }
                      
                      
                       case 9:
                       {
      
                           printf("_______");
                        
                           printf("|");
                          
                           if (x==7)
                          {
                          printf("    ");
                          printf("\n");
              
                          }
                          
                          else{}
                          break;
                          
                       }
                      
                      
                       case 10:
                       {
                           printf("_______");
                        
                           printf("|");
                          
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 11:
                       {
                           printf("_______");
                        
                           printf("|");
                          
                         if (x==7)
                       {
                        printf("    ");
                        printf("\n");
              
                        }
                          
                           else{}
                           break;
                       }
                      
                      
                       case 12:
                       {
                           printf("_______");
                        
                           printf("|");
                          
                           if (x==7)
                           {
                             printf("    ");
                             printf("\n");
              
                           }
                          
                           else{}
                           break;
                        }
                        
                        default:
                       {
                           if ((x+y)%2==0)
                           {
                           printf("_______");
                           }
                           else
                           {
                           printf("_______");
                           }
                          
                           printf("|");
                          
                           if (x==7)
                           {
                           printf("    ");
                           printf("\n");
              
                           }
                          
                           else{}
                           break;
                        }
                   }
               break;
              }
              
              
           }
                    
       }
   }
}





                  
                   printf("\n");
                   printf("     ");
                  
                   printf("   A       B       C       D       E       F       G       H   ");
                  
                  
                   printf("    ");
                   printf("\n");
                   printf("\n");
                  
  l=0;                 
  do
  {   
       l++;           
                  
  do
  {   
        
      
      if (l==1)
      {
      printf("Ingrese posicion de pieza a mover: ");
      
      }
      
      else
      {
         switch  (tab[h][i][0])
         {
           case 1:
           case 2:   
           printf("Peon ");
          
           if (turno%2==1)
           pieza=1;
           else
           pieza=2;
          
           break;
            
           case 3:
           case 4:   
           printf("Torre ");
          
           if (turno%2==1)
           pieza=3;
           else
           pieza=4;
          
           break;
            
           case 5:
           case 6:   
           printf("Caballo ");
          
           if (turno%2==1)
           pieza=5;
           else
           pieza=6;
          
           break;
          
           case 7:   
           case 8:   
           printf("Alfil ");
          
           if (turno%2==1)
           pieza=7;
           else
           pieza=8;
          
           break;
            
           case 9: 
           case 10:   
           printf("Reina ");
          
           if (turno%2==1)
           pieza=9;
           else
           pieza=10;
          
           break;
            
           case 11:
           case 12:   
           printf("Rey ");
          
           if (turno%2==1)
           pieza=11;
           else
           pieza=12;
          
           break;
          }
      
    
        
      printf("a casilla: ");
      
      
      }   
      
      
      
    cin >> b;
    printf("\n");
    
   for(d=0;d<16;++d)
    {
   if (b[0]==co1[d])
   {
   e=d;
   break;
   }
   else
   {}
  
   }
  
   for(f=0;f<8;++f)
    {
   if (b[1]==co2[f])
   {
   g=f;
   break;
   }
   else
   {}
  
   }
  
   if (d==16||f==8)
   {
   printf("\n");   
   printf("Valor erroneo, ingrese un valor valido");
   printf("\n");
   printf("\n");
   printf("\n");
   }   
  }while (d==16||f==8);   
 
  switch (e)
  {
 
  case 0:
  case 1:   
  h=0;
  break;
 
  case 2:
  case 3:
  h=1;
  break;
 
  case 4:
  case 5:
  h=2;
  break;
  
  case 6:
  case 7:
  h=3;     
  break;
      
  case 8:
  case 9:
  h=4;
  break;
 
  case 10:
  case 11:
  h=5;
  break;
 
  case 12:
  case 13:
  h=6;     
  break;
 
  case 14:
  case 15:
  h=7;     
  break;
  }
 
  switch (g)
  {
     case 0:   
     i=7;
     break;
      
     case 1:   
     i=6;
     break; 
    
     case 2:   
     i=5;
     break;
      
     case 3:   
     i=4;
     break;
      
     case 4:   
     i=3;
     break;
    
     case 5:   
     i=2;
     break;
    
     case 6:   
     i=1;
     break;
    
     case 7:   
     i=0;
     break;
  }
  
   if (l==1)
  
   {
       j=h;
       k=i;
      
      
      
       if (tab[h][i][0]==0)
       {
         printf("\n");     
         printf("Casilla vacia, ingrese otra posicion.");   
         printf("\n");
         printf("\n");
         printf("\n");
         l=0;
        }
    
        else
        {
               if (turno%2==1 && tab[h][i][0]%2==0)
               {
                 printf("\n");     
                 printf("Juegan las Blancas, escoja un a pieza Blanca.");   
                 printf("\n");
                 printf("\n");
                 printf("\n");
                 l=0;
                }
                
               else
                {
                        if (turno%2==0 && tab[h][i][0]%2==1)
                        {
                          printf("\n");     
                          printf("Juegan las Negras, escoja un a pieza Negra.");   
                          printf("\n");
                          printf("\n");
                          printf("\n");
                          l=0;
                         }
                 }
          }
          
    }
    
    else
    {
          
    }
    
    if (l==2)
          {
               if (tab[j][k][0]==tab[h][i][0])
               {
                          printf("\n");     
                          printf("Movimineto invalido");   
                          printf("\n");
                          printf("\n");
                          printf("\n");
                          l=1;
                }
                
                else
                {
                }
                
                switch (pieza)
                {
                
                case 1:
                      
                       if (k==6)
                       {
                       if ( (j==h) && ( (k==i+1) || (k==i+2) ) )
                      
                       {
                        continue;   
                       }
                      
                       else
                       {
                           if ((( ( (j==h+1)||( (j==h-1)&&(k==i+1) ) )&&(tab[h][i][0]!=0)&&(tab[h][i][0]%2==0))))
                           {
                               continue;
                           }
                           else
                           {
                            printf("\n");     
                            printf("Movimineto invalido");   
                            printf("\n");
                            printf("\n");
                            printf("\n");
                            l=1; 
                            }
                       }
                       }
                       else
                       {
                       if ((j==h) && (k==i+1))
                      
                       {
                       continue;
                       }
                      
                       else
                       {
                           if ((j==h+1)||((j==h-1)&&(k==i+1)))
                           {
                               continue;
                           }
                           else
                           {
                            printf("\n");     
                            printf("Movimineto invalido");   
                            printf("\n");
                            printf("\n");
                            printf("\n");
                            l=1; 
                            }
                       }
                       }
                      
                  
                break;
                      
                case 2:
                      
                       if (k==1)
                       {
                       if ( (j==h) && ( (k==i-1) || (k==i-2) ) )
                      
                       {
                        continue;   
                       }
                      
                       else
                       {
                           if ((j==h+1)||((j==h-1)&&(k==i-1)))
                           {
                               continue;
                           }
                           else
                           {
                            printf("\n");     
                            printf("Movimineto invalido");   
                            printf("\n");
                            printf("\n");
                            printf("\n");
                            l=1; 
                            }
                       }
                       }
                       else
                       {
                       if ((j==h) && (k==i-1))
                      
                       {
                       continue;
                       }
                      
                       else
                       {
                           if ((j==h+1)||((j==h-1)&&(k==i-1)))
                           {
                               continue;
                           }
                           else
                           {
                            printf("\n");     
                            printf("Movimineto invalido");   
                            printf("\n");
                            printf("\n");
                            printf("\n");
                            l=1; 
                            }
                       }
                       } 
                break;
            
                case 3:
                case 4:
          
                break;
            
                case 5:
                case 6:
                      
                break;
          
                case 7:   
                case 8:
                      
                break;
            
                case 9: 
                case 10:
          
                break;
            
                case 11:
                case 12:
          
                break;   
    
           }
   }
    
    
  
  }while (l<2);
 
  tab[h][i][0]=tab[j][k][0];
 
  tab[j][k][0]=0;
 
  turno++;
 
 
                  
 }while (1==1);               
                  
 


return 0;
}
 
pieza, the leaning tower of
also i love the }while(1==1) at the end
 
pieza, the leaning tower of
also i love the }while(1==1) at the end
I've known people who do that as a debugging technique. Just leaving it there and then editing the code (usually on production or staging) to change it to 1==0 to lop off branches of functionality. Yes, that probably constitutes a war crime.

the try within a try is making me laugh and horrified at the same time
He'd heard that if at first you don't succeed, try { try {} } again.

Anyway, while I'm here can I just nominate everybody who has ever been involved with package management for Python. The entire ecosystem is cursed. Constant juggling of python versions to meet requirements, bizarre lack of forwards compatibility, pip, wheels, venvs, conda, sources from your distro, poetry... And having been joyfully absent from Python for sometime and having just blown the dust off my skills for a small personal project, I learn that there's now a package manager written in Rust.

Why does it need to be written in Rust? Yes, between network speeds and file writes, I've always thought internal performance of the executable dealing with a handful of version checks and some strings was the real blocker that needed optimising.

The dependencies in even a modest Python project look like an explosion in a spaghetti factory. The package for this version of Python depends on a package that isn't compatible with this version of Python? Every second How To seems to include a bunch of wget'ing wheel files mixed with Pip and UV and gods above - PHP is infinitely better organised! You hear that Python devs?
 
Anyway, while I'm here can I just nominate everybody who has ever been involved with package management for Python. The entire ecosystem is cursed. Constant juggling of python versions to meet requirements, bizarre lack of forwards compatibility, pip, wheels, venvs, conda, sources from your distro, poetry... And having been joyfully absent from Python for sometime and having just blown the dust off my skills for a small personal project, I learn that there's now a package manager written in Rust.
at least i can use my system package manager to install most of the shit i would want UNLIKE A CERTAIN OTHER LANGUAGE WHOSE NAME STARTS WITH AN R AND RHYMES WITH "DUST"
now that is a truly cursed ecosystem
Why does it need to be written in Rust? Yes, between network speeds and file writes, I've always thought internal performance of the executable dealing with a handful of version checks and some strings was the real blocker that needed optimising.
with how python dependency chains get it might actually need that "blazingly fast performance" to sort out all those 3 million node graphs
The dependencies in even a modest Python project look like an explosion in a spaghetti factory.
see you just can't get good performance for managing those complex graphs in python especially if from graphmangler import stupidfuckingsubmodule as g fails to load because the system graphmangler with optimized c++ graph operations is 1.4.3 and the program was written against 1.4.4
 
Back