pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
for (x=0;x<tubes[i]->xres*2.0f;x++)
added on the 2006-12-21 22:59:14 by Preacher Preacher
Let me try something. [urldata:image/jpeg;base64,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]picture[/url]
That's not a link; it's a data uri. If it works, I've just "uploaded" a picture to the bbs.
added on the 2006-12-21 23:03:35 by Steohawk Steohawk
Let me try this again. picture
added on the 2006-12-21 23:04:52 by Steohawk Steohawk
Huh? It didn't work. The bbs software added an http uri at the begginning. Just copy the link into your address bar, and remove the "http://" It should display a picture that is embedded into the url.
added on the 2006-12-21 23:07:31 by Steohawk Steohawk
Well, you've fucked this thread up, haven't you? :)
added on the 2006-12-21 23:11:33 by xeron xeron
Preacher : tubes? lines, surely!?!?!?
int *temp = (int *)malloc((width/2)*(height/2)*sizeof(int));
added on the 2006-12-21 23:15:02 by Sverker Sverker
nop
added on the 2006-12-21 23:15:46 by waffle waffle
if( ( filename[len-1]=='G' || filename[len-1]=='g' ) && ( filename[len-2]=='P' || filename[len-2]=='p' ) && ( filename[len-3]=='J' || filename[len-3]=='j' ) )
added on the 2006-12-21 23:18:11 by shadez shadez
moveq #0, d0
added on the 2006-12-21 23:19:11 by Hyde Hyde
int para;
added on the 2006-12-21 23:20:59 by ragnor ragnor
#include <ncurses.h>/*****************************************************/
int m[256 ] [ 256 ],a
,b ;;; ;;; WINDOW*w; char*l="" "\176qxl" "q" "q" "k" "w\
xm" "x" "t" "j" "v" "u" "n" ,Q[
]= "Z" "pt!ftd`" "qdc!`eu" "dq!$c!nnwf"/** *** */"t\040\t";c(
int u , int v){ v?m [u] [v-
1] |=2,m[u][v-1] & 48?W][v-1 ] & 15]]):0:0;u?m[u -1][v]|=1 ,m[
u- 1][ v]& 48? W-1 ][v ]&
15] ]):0:0;v< 255 ?m[ u][v+1]|=8,m[u][v+1]& 48? W][ v+1]&15]]
):0 :0; u < 255 ?m[ u+1 ][v ]|=
4,m[u+1][ v]&48?W+1][v]&15]]):0:0;W][ v]& 15] ]);}cu(char*q){ return
*q ?cu (q+ 1)& 1?q [0] ++:
q[0 ]-- :1; }d( int u , int/**/v, int/**/x, int y){ int
Y=y -v, X=x -u; int S,s ;Y< 0?Y =-Y ,s,
s=- 1:( s=1);X<0?X=-X,S =-1 :(S= 1); Y<<= 1;X<<=1; if(X>Y){
int f=Y -(X >>1 );; while(u!= x){
f>= 0?v+=s,f-=X:0;u +=S ;f+= Y;m[u][v]|=32;mvwaddch(w,v ,u, m[u
][ v]& 64? 60: 46) ;if (m[ u][
v]&16){c(u,v);; ;;; ;;; return;}} }else{int f=X -(Y>>1);; while
(v !=y ){f >=0 ?u +=S, f-= Y:0
;v +=s ;f+=X;m[u][v]|= 32;mvwaddch(w,v ,u,m[u][v]&64?60:46);if(m[u
][ v]& 16) {c( u,v );
; return;;;}}}}Z( int/**/a, int b){ }e( int/**/y,int/**/ x){
int i ; for (i= a;i <=a
+S;i++)d(y,x,i,b),d(y,x,i,b+L);for(i=b;i<=b+L;i++)d(y,x,a,i),d(y,x,a+ S,i
); ;;; ;;; ;;; ;;; ;
mvwaddch(w,x,y,64); ;;; ;;; ;;; prefresh( w,b,a,0,0 ,L- 1,S-1
);} main( int V , char *C[
] ){FILE*f= fopen(V==1?"arachnid.c"/**/ :C[ 1],"r");int/**/x,y,c,
v=0 ;;; initscr (); Z(Z (raw
() ,Z( curs_set(0),Z(1 ,noecho()))),keypad( stdscr,TRUE));w =newpad
( 300, 300 ) ; for (x= 255 ; x >=0 ;x--
) for (y= 255 ;y>=0;y-- )m[ x][ y]= 0;x=y=0;refresh( );while
( (c= fgetc (f) )+1) {if(
0||c==10|| x== 256){x=0;y++;if(y==256 )break;;} else{m[x][y]=(c ==
'~' ?64 : c ==32 ?0: 16) ;;x ++;
}}for(x=0 ;x< 256;x++)m [x][0]=16 ,m[ x][ 255]=16;for(y=0
;y< 256 ; y ++) m[0 ][y ] = 16,
m[255][y] =16 ;a=b=c=0; x=y =1; do{v++;mvwaddch (w, y,x ,m[
x][ y]& 32? m[x ][y ] & 16?
0| acs_map[l[m[x][y]&15]]:46 : 32);c==0163&&!(m[x][y+1]&16)?y++: 0;c
== 119 &&! (m[ x][
y- 1]& 16) ?y--:0;;c ==97 &&!(m[x-1][y]&16)?x--:0;c==100&&!(m[x+1
][ y]& 16) ? x ++:0 ;if( c==
3- 1+1 ){endwin( );; return(0) ;}x -a<5?a>S- 5?a-=S-5:(a=0):
0;x -a> S-5?a<255 -S* 2?a +=S
-5:(a=256-S):0; y-b<5?b>L-5?b-=L-5:(b =0) :0; y-b>L-5?b<255-L *2?
b+= L-5 :(b =256
-L) :0;e(x,y);if(m[x][y]&64)break;}while((c=getch())!=-1);endwin();cu(Q);
printf(Q,v);}
added on the 2006-12-21 23:21:12 by Stelthzje Stelthzje
ldi [hli],a
added on the 2006-12-21 23:21:38 by annieeee annieeee
i even managed to include a typo! fuks.
added on the 2006-12-21 23:22:33 by annieeee annieeee
#define Nd Np define
#define Ni(N) Np include <std##N##.h>
#define Np ??=

Ni(def)
Ni(io)
Ni(lib)

Nd Ba BC(B, I)
Nd Be BC(Br, I)
Nd Ca(C, Ca) CB(B, In C, Ca)
Nd Cl(Cl) Cl Cl
Nd Cs const
Nd FrB N = Zr; Fr((O, B = BrB(BrF, I)))
Nd Fe(F) FO (In = Zr; F; In++)
Nd FF FB(B); FB(BF);
Nd FI Fe(IO)
Nd FO for
Nd Fr(F) FO (I = Zr; F; I++)
Nd II I I, In
Nd In(I, Ir) main(I, Ir)
Nd IO In[O[C + I]]
Nd Ir(I) if (I)
Nd Nb N > N && N > -O
Nd Rb(Rb, B) BBr(Br, Rb, B)
Nd Re return
Nd Sc struct
Nd Si(Te) sizeof (Te)
Nd Te typedef
Nd Zn N < Zr

Te char C;
Te int I;
Te size_t Si;
Te void V;

Cs C *Na =

"H " "He "
"Li Be " "B C N O F Ne "
"Na Mg " "Al Si P S Cl Ar "
"K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr "
"Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe "
"Cs Ba* Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn "
"Fr Ra**"

" *La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb "
" **Ac Th Pa U Np Pu ";
Cs C *Xe = "111%%d:\0\n";
Cs C H[] = "22";
Cs C U[] = "3";
Cs I Zr = 0;
Cs I O = 1;
Cs I W = 2;

V (*At)(V) = abort;
V (*F)(V *) = free;
V *(*Mo)(Si) = malloc;
I (*Pr)(Cs C *, ...) = printf;
I (*P)(I) = putchar;

Nd Tm(B,C) \
Sc B { \
C *B; \
I N; \
} ; \
Te Sc B *B; \
\
B N##B (I) ; \
V F##B (B) ; \
C B##C (B, I) ; \
V C##B (B, I, C) ; \
\
B N##B (I N) { \
B B; \
\
Re (W, B = Mo(Si(Sc B))) ? \
(O, B->B = Mo(((W, B->N = N) ? N : O) * Si(C))) ? \
B Cl(: (At(), B)); \
} \
V F##B (B B) { \
F(B->B); \
F(B); \
} \
C B##C (B B, I N) { \
Re B->Nb ? B->B[N] : (C) Zr; \
} \
V C##B (B B, I N, C C) { \
N; \
B->Nb ? B->B[N] = C : C ? At(), C : C; \
}

Tm(B,C)

V Pb (B) ;
I Bi (B) ;
C Co (B, B, I) ;
B Sb (B, I) ;

V Pb (B B) {
I I;
Fr(Ba)
P(Ba);
}
I Bi (B B) {
I I;
Fr(Ba) ;
Re I;
}
C Co (B Br, B B, I N) {
I I;
Fr(I < N)
Ir(Be - Ba)
Re Be - Ba;
Re Zr;
}
B Sb (B Br, I N) {
B B;
I I;

B = NB(Zn ? Bi(Br) + N : N);
FO(I = Zn ? -N : Zr; Zn ? Be : I < N; I++)
CB(B, Zn ? I + N : I, Be);
Re B;
}

Tm(Br,B)

V PBr (Br, I) ;

V PBr (Br B, I N) {
I I;
Pr(W * W + Xe, N);
Fr(BrB(B, I)) {
P(O[Na]);
Pb(BrB(B, I));
}
P(Xe[W << W]);
}

B Dy (B, I) ;
I S (C, B) ;
Br Sr (Br) ;

B Dy (B Br, I N) {
B B;
C C, Cr;
II;

B = NB(W * Bi(Br));
FO(In = I = Zr; (O, C = Be); I++) {
FO(Cr = O; (W, C == BC(Br, I + Cr)); Cr++) ;
I += Cr - O;
Ca(++, Cr + Si(H)**H - Si(U)**U);
Ca(++, C);
}
Ir(N)
FB(Br);
Ca(-N, W[H]);
Re B;
}
I S (C C, B Br) {
B B, BF;
II;

Ir(C == BC(Br, Zr))
Re Zr;

Fr(Be) {
B = Cl(BF = Sb(Br, I); )

Fe(BC(B, Zr)) {
B = Dy(B, W);
Ir(C == BC(B, Zr)) {
FF
Re Zr;
}

Ir(In % W)
BF = Dy(BF, W);

Ir(Zr == Co(B, BF, Bi(BF))) {
FF
Re O;
}
}

FF
}
B = Dy(Br, Zr);
I = S(C, B);
FB(B);
Re I;
}
Br Sr (Br BrF) {
Br Br;
B B, BF;
II, N;

FrB
N += Bi(B);
Br = NBr(N);
FrB {
Rb(N++, B);
Fe(BC(B, In + O))
S(BC(B, In), BF = Sb(B, -In - O)) ?
Ca(+O, O[U]),
Rb(N++, B = BF),
In = Zr :
(FB(BF), W);
}
FBr(BrF);
Rb(N, (V *) Zr);
Re Br;
}

I In (I, C **) ;

I In (I N, C ** C) {
Br Br;
B B;
II;

Br = NBr(--N);
Fr(I < N) {
FI ;
Rb(I, B = NB(In));
FI
Ca(-Zr, IO);
}

Fr(BrB(Br, Zr)) {
Br = Sr(Br);
PBr(Br, I);

Fe((W, B = BrB(Br, In))) {
Rb(In, Dy(B, Zr));
FB(B);
}
}

{ } { } { } { } { } { } { } { } { } { } { }
{ } { { } } { } { } { } { } { } { } { } { } { { } }
{ { } } { } { } { } { } { } { } { { } } { } { } { { } } C;
{ } { { } } { } { } { } { } { } { } { } { } { { } }
{ } { } { } { } { } { } { } { } { } { } { }

Re Zr;
}
added on the 2006-12-21 23:22:42 by Stelthzje Stelthzje
Spock: That didn't look like a maze. ;)
added on the 2006-12-21 23:23:01 by Hyde Hyde
#include<curses.h>
#include<stdlib.h>
#include<string.h>

#define A int
#define F float
#define O sizeof
#define V ((A *)(X+N))
#define U(a,b) for(a = 0; a < b; a++)
#define L(a) (X[K] * H[a*4]+ X[K+1] * H[a*4+1]+ X[K+2] * H[a*4+2])
#define _(e,f,a,b,c) if(M==e) { T[a*4+c] = T[b*4+c] = T[c*4+a] = T[c*4+b] = !(T[c*5] = 1); T[a*4+b] = -(T[b*4+a] = f .1045284632); T[b*5] = T[a*5] = .9945418726; U(M,3) U(E,4) U(K,3) R[M*4+E] += H[K*4+E] * T[M*4+K]; memcpy(H,R,12*O(F)); }

char Q[3792];
A K, M=0, E, B;
long Z;
F H[] = { 1,0,0,0,0,1,0,0,0,0,1,0 } , T[12], R[12], C, D, I, J, S, * X, G=4;
FILE * W;

A main(A N,char ** Y) {
char P[] = "AlWuzEre 72 -1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 ";
strcpy(Q,P);
if(!(W = fopen(Y[N<2?0:1],"r"))) {
printf("Can't read\n"); exit(-1); }
fseek(W,0,SEEK_END);
Z = ftell(W);
fseek(W,0,SEEK_SET);
strcpy(Q+9, "%d");
while(fscanf(W,Q,&N) != 1) {
fseek(W,1,SEEK_CUR);
if(ftell(W) >= Z) {
printf("Bad input\n"); exit(-1); } }

X = (F *)malloc(N * (O(A)>O(F)?O(A):O(F)) * 2);
if(!X) { printf("No memory\n"); exit(-1); }
U(K,N) fscanf(W,"%f",X+K);
fclose(W);

initscr();
halfdelay(30);
noecho();

CH:
memset(R,0,12*O(F));
_('h', ,1,2,0)
_('j', ,2,0,1)
_('k', ,1,0,2)
_('y',-,1,2,0)
_('u',-,2,0,1)
_('i',-,1,0,2)
G += M=='a'?-.1:M=='z'?.1:0;
if(M=='q') { printf("%.9s\n",P); exit(0); }

memset(Q,0,3792);
erase();

U(K,N) {
C = 40 / (L(2)+G);
V[K] = (A)(L(0) * C) + 40;
V[K+1] = (A)(L(1) * C) + 24;
K+=2; }

U(B,N) {
C = V[B++];
D = V[B++];
E = V[++B] - C;
M = V[++B] - D;
B++;
S = (F)abs((abs(E)>abs(M))?E:M);
I=E/S;
J=M/S++;
U(K,S)
{
E = (A)(C+0.5);
M = (A)(D+0.5);
if(E>=0 && M>=0 && E<79 && M<48)
{
Q[E + M * 79] = 1;
mvaddch((M&1?M-1:M)/2,E,Q[E+(M+(M&1?-1:1))*79]?':':(M&1?'.':'`'));
}
C+=I;
D+=J;
}
}

move(0,0);
refresh();

M = getch();
halfdelay(M==ERR?1:30);
M = M==ERR?'u':M;

goto CH;
}
added on the 2006-12-21 23:23:44 by Stelthzje Stelthzje
; Flash a single byte, using the data in FDA, and the addr in
; FRADLO/HI. FCNT will contain how many more times we would
; have tried it. If it fails, FFDA contains the data that was
; read back. Nothing is preserved.
FLASHB:
LDY #$19 ; Max of 25 retries
LDX #$0 ; init X
FLOOP:
LDA #$40 ; send Program Byte command
STA (TOADLO,X)
LDA FDA ; send the data to be programmed
STA (TOADLO,X)
; The next 4 instructions are a time delay: a total of
; around 10us with a 1.8 MHz clock. The exact amount isn't
; critical, but should be *at least* 10us.
ROR 0
ROL 0
NOP
NOP
; The next 2 instructions count as part of the delay:
LDA #$C0 ; send the Verify command
STA (TOADLO,X)
LDA (TOADLO,X) ; read the programmed byte
CMP FDA ; is it the same?
BEQ FDONE ; yes, we're done
DEY ; no, try again
BNE FLOOP
FDONE:
STY FCNT ; save the number of loops
STA FFDA ; save the last data we read
LDA #$0 ; send the Read Mode command
STA (TOADLO,X)
RTS

; Erase the flash. The flash is 128K, but all we
; can address is 32K, so just erase that (really the
; entire device is being erased, but we are only verifying
; the first 32K). Nothing is preserved.
ERASE:
LDX #$00
LDA #$00 ; Init our temp storage
STA FDA ; We will program all bytes to #$00 first.
STA TOADLO ; Flash starts at address $6000.
LDA #$60
STA TOADHI
ERASE1:
JSR FLASHB ; Program a byte
INC TOADLO ; INC to next address
BNE ERASE1 ; No wrap - go do next address
INC TOADHI ; Wrapped - INC hi byte
LDA #$E0 ; Did we go beyond 32K ?
CMP TOADHI
BNE ERASE1 ; No, go do this address
LDA #$0 ; Yes, get ready to erase
STA TOADLO
STA ECNTLO ; erase-cycle counter
STA ECNTHI
LDA #$60 ; back to the beginning
STA TOADHI
ERASE2:
LDA #$20 ; send the Erase command
STA (TOADLO,X)
STA (TOADLO,X) ; we must send it twice
LDA #$3 ; Delay for about 12 ms (10 ms required)
JSR DELAY ;
ERASE3:
LDA #$A0 ; send the Erase Verify command
STA (TOADLO,X)
LDA (TOADLO,X) ; is the data #$FF ?
CMP #$FF
BNE ERASE4 ; no, go INC counters and try again
INC TOADLO ; yes, INC the address counter
BNE ERASE3
INC TOADHI
LDA TOADHI
CMP #$E0 ; are we beyond 32K ?
BNE ERASE3 ; no, do another erase cycle
EDONE:
LDA #$0 ; we're done - send the Read Mode command
STA (TOADLO,X)
RTS
ERASE4:
INC ECNTLO ; INC the erase-retry counter
BNE ERASE2
INC ECNTHI
LDA ECNTHI
CMP #$4 ; have we done more than 1000 cycles?
BEQ EDONE ; yes - quit (failure)
BNE ERASE2 ; no - do another erase cycle
added on the 2006-12-21 23:24:47 by Stelthzje Stelthzje
this fscking bbs is screwing up all the code..

wait..

the code tag!!
added on the 2006-12-21 23:25:44 by Stelthzje Stelthzje
Code:#include <ncurses.h>/*****************************************************/ int m[256 ] [ 256 ],a ,b ;;; ;;; WINDOW*w; char*l="" "\176qxl" "q" "q" "k" "w\ xm" "x" "t" "j" "v" "u" "n" ,Q[ ]= "Z" "pt!ftd`" "qdc!`eu" "dq!$c!nnwf"/** *** */"t\040\t";c( int u , int v){ v?m [u] [v- 1] |=2,m[u][v-1] & 48?W][v-1 ] & 15]]):0:0;u?m[u -1][v]|=1 ,m[ u- 1][ v]& 48? W-1 ][v ]& 15] ]):0:0;v< 255 ?m[ u][v+1]|=8,m[u][v+1]& 48? W][ v+1]&15]] ):0 :0; u < 255 ?m[ u+1 ][v ]|= 4,m[u+1][ v]&48?W+1][v]&15]]):0:0;W][ v]& 15] ]);}cu(char*q){ return *q ?cu (q+ 1)& 1?q [0] ++: q[0 ]-- :1; }d( int u , int/**/v, int/**/x, int y){ int Y=y -v, X=x -u; int S,s ;Y< 0?Y =-Y ,s, s=- 1:( s=1);X<0?X=-X,S =-1 :(S= 1); Y<<= 1;X<<=1; if(X>Y){ int f=Y -(X >>1 );; while(u!= x){ f>= 0?v+=s,f-=X:0;u +=S ;f+= Y;m[u][v]|=32;mvwaddch(w,v ,u, m[u ][ v]& 64? 60: 46) ;if (m[ u][ v]&16){c(u,v);; ;;; ;;; return;}} }else{int f=X -(Y>>1);; while (v !=y ){f >=0 ?u +=S, f-= Y:0 ;v +=s ;f+=X;m[u][v]|= 32;mvwaddch(w,v ,u,m[u][v]&64?60:46);if(m[u ][ v]& 16) {c( u,v ); ; return;;;}}}}Z( int/**/a, int b){ }e( int/**/y,int/**/ x){ int i ; for (i= a;i <=a +S;i++)d(y,x,i,b),d(y,x,i,b+L);for(i=b;i<=b+L;i++)d(y,x,a,i),d(y,x,a+ S,i ); ;;; ;;; ;;; ;;; ; mvwaddch(w,x,y,64); ;;; ;;; ;;; prefresh( w,b,a,0,0 ,L- 1,S-1 );} main( int V , char *C[ ] ){FILE*f= fopen(V==1?"arachnid.c"/**/ :C[ 1],"r");int/**/x,y,c, v=0 ;;; initscr (); Z(Z (raw () ,Z( curs_set(0),Z(1 ,noecho()))),keypad( stdscr,TRUE));w =newpad ( 300, 300 ) ; for (x= 255 ; x >=0 ;x-- ) for (y= 255 ;y>=0;y-- )m[ x][ y]= 0;x=y=0;refresh( );while ( (c= fgetc (f) )+1) {if( 0||c==10|| x== 256){x=0;y++;if(y==256 )break;;} else{m[x][y]=(c == '~' ?64 : c ==32 ?0: 16) ;;x ++; }}for(x=0 ;x< 256;x++)m [x][0]=16 ,m[ x][ 255]=16;for(y=0 ;y< 256 ; y ++) m[0 ][y ] = 16, m[255][y] =16 ;a=b=c=0; x=y =1; do{v++;mvwaddch (w, y,x ,m[ x][ y]& 32? m[x ][y ] & 16? 0| acs_map[l[m[x][y]&15]]:46 : 32);c==0163&&!(m[x][y+1]&16)?y++: 0;c == 119 &&! (m[ x][ y- 1]& 16) ?y--:0;;c ==97 &&!(m[x-1][y]&16)?x--:0;c==100&&!(m[x+1 ][ y]& 16) ? x ++:0 ;if( c== 3- 1+1 ){endwin( );; return(0) ;}x -a<5?a>S- 5?a-=S-5:(a=0): 0;x -a> S-5?a<255 -S* 2?a +=S -5:(a=256-S):0; y-b<5?b>L-5?b-=L-5:(b =0) :0; y-b>L-5?b<255-L *2? b+= L-5 :(b =256 -L) :0;e(x,y);if(m[x][y]&64)break;}while((c=getch())!=-1);endwin();cu(Q); printf(Q,v);}
added on the 2006-12-21 23:26:20 by Stelthzje Stelthzje
I'm code-dumb. I just do graphics. :-P
added on the 2006-12-21 23:29:50 by Steohawk Steohawk
Well someone has a hard time understanding the concept of "a line"...
added on the 2006-12-21 23:32:33 by teel teel
teel: I was about to post that thought as well :)
added on the 2006-12-21 23:33:34 by keops keops
10 PRINT"STFU! ";:GOTO 10
added on the 2006-12-21 23:36:41 by doomdoom doomdoom

login

Go to top