Cursed Programming

Anyways, I’ll hit the hay soon. But you’ll know what I’ll be doing tomorrow :smirk:
Cryllic O

1 Like

Breathing? :laughing:

1 Like

All you need to know is… look up ioccc :wink:

1 Like

The International Obfuscated C Code Contest, that’s really cool! Where can I find some of the winning contestants scripts?

1 Like

I’m not sure if it contains all of the entries but this repository has the winners for each year.

1 Like

Thank youuuu! I can’t wait to see the cursed designs people make, and what they think of lol.

Interesting…

lol its blocked

I have the same blocker, I recognize that screen as clear as day

I have a different one, so luckily it’s not blocked :slight_smile: (for now…)

By far the best entry on the entire site.

https://www.ioccc.org/2020/endoh1/index.html

Code
                               #include/**/<time.h>
                               #include <ncurses.h>
                               # include <stdlib.h>
             /**               */#define O()for(y-=               !!\
           y;y<H&&           /*...Semi-Automatic.*/y<           p/W+2;\
         y++)for(x=p%   W,x-=!!/*..MineSweeper...*/x;x<W&&   x<p%W+2;x++)
       #define _(x,y)COLOR_##x,COLOR_##y /*  click / (R)estart / (Q)uit  */
     #define Y(n)attrset(COLOR_PAIR(n)),mvprintw(/* IOCCC2019 or IOCCC2020 */
   typedef int I;I*M,W,H,S,C,E,X,T,c,p,q,i,j,k;char G[]=" x",U[256];I F(I p){ I
      r=0,x,y=p/W,q;O()q=y*W+x,r+=M[q]^=p-q?(M[q]&16)<<8:0;return r;}I K(I p
         ,I f,I g){ I x=(g+     f/256)%16-(f+g/256)%16,y=p/W,c=0,n=g/4096
          ,m=x==n?0:x==g           /16%16-f/16%16-n?256:-1; if(m+1)O()if
         ((4368&M[n=y*W             +x])==4112){ M[c=1,n]=(M[n]&~16)|m; }
        return c;}void              D(){I p,k,o=0,n=C,m=0,q=0;if(LINES-1<H
       ||COLS/2<W)clear             (),Y(4)LINES/2,COLS/2-16,"Make the ter\
minal bigger!");else{for           (p=0;p<S;o+=k==3,Y(k)p/W+1,p%W*2,G),p++)G[1]=""
"_*!..12345678"[k=E?256&M[p     ]?n--,2:E-2||M[p]%2<1?M[p]&16?q=p,m++,3:4+F(p)%16:
1:3];k=T+time(0);T=o||T>=0||E-1?T:k;k=T<0?k:T;Y(7)0,0,"%03d%*s%03d",n>999?999:n,W*
2-6,"",k>999?999:k);Y(9)0,W-1,E>1?"X-(":E-1||o?":-)":"8-)");M[q]|=256*(n==m&&n); }
refresh();}short B[]={_(RED,BLACK),_(WHITE,BLUE),_(GREEN,RED),_(MAGENTA,YELLOW),_(
CYAN,RED)};I main(I A,char**V){MEVENT e;FILE*f;srand(time(0));initscr();for(start\
_color();X<12;X++){init_pair(X+1,B[X&&X<10?X-1:2],B[X?X<3?2:1:0]);}noecho();cbreak
();timeout(9);curs_set(0);keypad(stdscr,TRUE);for(mousemask(BUTTON1_CLICKED|BUTTO\
N1_RELEASED,0);;){S=A<2?f=0,W=COLS/2,H=LINES-1,C=W*H/5,0:fscanf(f=fopen(V[A-1],"r"
       ),"%d %d %d",&W,&H,&C)>3; ;S+=W*H;M=realloc(M,S*sizeof(I)*2);for(i=0
        ;i<S;i++)!f?M[i]=i,i&&(k=M[j=rand()%i],M[j]=M[i],M[i]=k):fscanf(f,
         "%d",M+i);if(f)fclose(f);T=E=X=0;for(clear();D(),c=getch(),c-'r'
          &&(c-KEY_RESIZE||E);){ if(c=='q'){ return(endwin(),0); }if(c==
        KEY_MOUSE&&getmouse(&e)==OK&&e.x/2<W&&e.y<=H){if(!e.y&&(W-2<e.x&&
      e.x<W+2)){break;}p=e.x/2+e.y*W-W;if(p>=0){if(!E){for(i=0;i<S;i++)M[S+M
   [i]]=i,M[i]=16+(M[i]<C);C-=M[p]&1;M[p]=16;E=1;T=-time(0);}if(E<2)M[p]&=(M[p]
     &257)==1?T+=time(0),E=2,273:257;}}for(p=0;p<S&&E==1;M[p++]&=273){}for(i=
       (X+S-1)%S;E==1&&i!=X;X=(X+1)%S){if(!(M[p=M[X+S]]&272)){if(K(p,c=F(p)
         ,0)){goto N;}   for(k=p/W-2,k=k<0?0:k;k<p/W+3&&k   <H;k++)for(j=
           p%W-2,j          =j<0?0:j;j<W&&j<p%W+3;)if           (!(M[q=
             k*W               +j++]&272)){ if(K(p,               c,F
                               (q))){ goto N; }F(q)
                               ; }F(p); }}N:; } } }
                               /*(c)Yusukse Endoh*/
1 Like

that’s just obfuscated code :thinking:

goguardian gang whoo

1 Like

Screen Shot 2023-05-25 at 6.45.46 PM
hahahahha… the poll is just locked (insert sad emoji)

import sys as system

class printHelper:
  def __init__(self, printHelperArgument):
    exec(
      '''self.printHelperArgument = printHelperArgument;'''
    );
    self.newLineCharacter: str = "\n";

  def getNewLineCharacter(self) -> str:
    return self.newLineCharacter;

  def printArgument(self):
    {
      system.stdout.write(
        self.printHelperArgument+''+self.getNewLineCharacter()    
      )
    };

printFunction = lambda printArgument: ({
                  printHelper(printArgument)
                    .printArgument()
                });
    
printFunction("Hello, World!");
# count to 10
print(str(1));
print(str(2));
print(str(3));
print(str(4));
print(str(5));
print(str(6));
print(str(7));
print(str(8));
print(str(9));
print(str(10));
2 Likes

Looking at one of my past projects:

array = []
string = "Hello World!"

for item in string.split(" "):
  array.append(item)

So I tried running that code…

And here’s what I got:

11 posts were split to a new topic: Which is better, var or let? (JavaScript)

For people learning javascript, this is the correct way to use console.log

Object["assign"].constructor("return console")()[([Object["keys"](console.log["constructor"]("return [eval(\"console\")]")()[0])]["".length][1+1+(console?.prototype?.prototype==undefined)])]("Hello world!")

#!/bin/bash

printf "\0" >> "0"
for _ in {0..1000}; do
for i in {1..10}; do
  cat $((i - 1)) >> $i
  printf "\0" >> $i
done
cat "10" > "0"
done &
bash main.sh