ITT the ABC Programming Language
1
Name:
Anonymous
2008-07-29 19:29
#include <stdio.h>
int main(int argc,char argv*[]){
int i = 0;
int BUFFA;
while(argv[i]!='\0'){
if(argv[i]='a')
BUFFA++;
else if(argv[i]='b')
BUFFA--;
else if(argv[i]='c')
printf("%i\n",BUFFA);
else printf("%s","Error.\n");
}
}
281
Name:
Anonymous
2009-08-16 3:41
Lain.
282
Name:
Anonymous
2009-08-16 3:43
Lain.
283
Name:
Anonymous
2009-08-16 3:46
Lain.
284
Name:
Anonymous
2009-08-16 4:04
Lain.
285
Name:
Anonymous
2009-08-16 4:11
Lain.
286
Name:
Anonymous
2009-08-16 4:15
Lain.
287
Name:
Anonymous
2009-08-16 6:28
Lain.
288
Name:
Anonymous
2010-08-15 15:29
>>1
Proof that Xarn wrote shitty code in the past.
289
Name:
Anonymous
2010-08-15 15:44
>>288
1. It's good code.
2. There's no proof it's that guy.
290
Name:
Anonymous
2010-08-15 15:44
291
Name:
Anonymous
2010-08-15 15:58
>>289
1. It's good code.
Except it doesn't work. I counted two problems before I stopped reading right there after three seconds.
292
Name:
Anonymous
2010-08-15 15:59
293
Name:
Anonymous
2010-08-15 16:10
chuis chatfatigué le haxxeur et j'ai une zone privée de haxx ;) haxx haxx !
294
Name:
Anonymous
2010-08-15 16:12
>>291
What do you think is wrong with that code?
295
Name:
Anonymous
2010-08-15 16:22
>>294
1.
char argv*[]
2.
BUFFA not initialized.
296
Name:
Anonymous
2010-08-15 17:30
;; BUFFA.asm
;; @Author -- Gerald Jay Sussman
;; Assemble with nasm -f elf BUFFA.asm
;; Link with ld --dynamic-linker /lib/ld-linux.so.2 -lc BUFFA.o -o BUFFA
%macro exit 1
mov eax, 1
mov ebx, %1
int 0x80
%endmacro
%macro write 1
mov dword [ecx], %1
mov eax, 4
mov ebx, 1
mov edx, 1
int 0x80
%endmacro
section .data
err: dw "Usage: %s [food_for_BUFFA]", 0xa
rwe: dw "BUFFA doesn't eat %c's", 0xa
section .text
extern printf
global _start
_start:
pop ebx
cmp ebx, 0x1
je .usage
pop eax
pop ecx
xor ebx, ebx
xor edx, edx
.doloop:
mov eax, [ecx+edx]
cmp al, 0x0
je .die
call read_and_write
inc edx
jmp .doloop
.die:
write 0xa
exit 0
.usage:
pop ebx
mov ebp, esp
push ebx
push err
call printf
exit 1
read_and_write:
cmp al, 0x61
je .a
cmp al, 0x62
je .b
cmp al, 0x63
je .c
jmp .err
.a:
inc ebx
jmp .ret
.b:
dec ebx
jmp .ret
.c:
call print_buffa
jmp .ret
.ret:
ret
.err:
mov ebp, esp
push eax
push rwe
call printf
exit 2
print_buffa:
pusha
write ebx
popa
ret
297
Name:
Anonymous
2010-08-15 17:38
>>156
optimise your BBCODE
298
Name:
Anonymous
2010-08-15 17:43
>>295
The first is just bad form. The second, yeah, that's 'incorrect', but it's becoming increasingly rarer that it will cause a problem. You missed the one that makes it behave erratically on windows.
299
Name:
Anonymous
2010-08-15 17:45
>>288
Xarn did not write
>>1 , but I think I remember he said he did write
>>53 .
300
Name:
Anonymous
2010-08-15 17:53
>>296
Also yes, that is
ebx for
BUFFA!.
301
Name:
Anonymous
2010-08-15 18:05
>>299
I wrote
>>1 . I'm the guy who emailed the Sussman, too. I've been grooming
/prog/ and providing it with humour for years, and since I'm not a real programmer, I couldn't care less what
FAGGOT GERALD thinks of me.
302
Name:
Anonymous
2010-08-15 19:55
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char **argv) {
FILE *input;
int c, acc = 0, ascii = 0;
if (argc != 2) {
fprintf(stderr, "usage: %s <file>\n", argv[0]);
return EXIT_FAILURE;
}
if (!(input=fopen(argv[1], "r"))) {
perror("fopen()");
return EXIT_FAILURE;
}
srand((unsigned)time((time_t *)NULL));
while ((c=fgetc(input)) != EOF) {
switch (c) {
#define INSTR(C,X) case (C): (X); break
INSTR('a', ++acc);
INSTR('b', --acc);
INSTR('c', ascii ? putchar(acc) : printf("%d", acc));
INSTR('d', acc = rand() / (RAND_MAX / acc +1));
INSTR('r', acc *= -1);
INSTR('n', acc = 0);
INSTR('$', ascii = !ascii);
INSTR('l', fseek(input, 0, SEEK_SET));
INSTR(';', printf("%d %c\n", acc, acc));
#undef INSTR
default:
break;
}
}
fclose(input);
return EXIT_SUCCESS;
}
303
Name:
Anonymous
2010-08-15 20:14
Maybe inverted means bitwise NOT?
304
Name:
Anonymous
2010-08-15 21:14
>>303
From the reference implementations it's now clear he meant multiplication by -1.
305
Name:
Anonymous
2010-08-16 1:17
>>302
EXPERT NEAT PREPROCESSOR USAGE
#define IF(cond, x) if (cond) {x}
306
Name:
Anonymous
2010-08-16 1:20
>>304
Maybe he meant a bitwise prolapse.
307
Name:
Anonymous
2010-08-16 2:40
>>305
Bah,
this is for experts:
#define IF(cond, x) if( (cond) ) {x}
308
Name:
Anonymous
2010-08-16 4:42
>>303,306
As an undergrad in Comp E, I invented the "exclusive NOT" gate:
A B | out
-----+----
0 0 | 0
0 1 | 0
1 0 | 0
1 1 | 0
309
Name:
Anonymous
2010-08-16 9:45
>>308
So, it doesn't do anything?
310
Name:
Anonymous
2010-08-16 10:06
>>309
Just like NOP, fuckshit.
311
Name:
Anonymous
2010-08-16 12:19
>>309-310
No, you morons. It does something: it gives you zero. If you wanted the value of zero, why would you use a no-op?
>>308
I thought NOT was unary.
312
Name:
Anonymous
2010-08-16 12:40
>>311
The XNOT is ``just like NOP'' in that it appears useless when you first see it, but in reality it
does have a use. Fuckshit.
313
Name:
Anonymous
2010-08-16 13:01
I think
>>309-312 accurately displays why /prog/-riders have no friends.
314
Name:
Anonymous
2010-08-16 13:57
>>313
You're projecting,
Xarn .
315
Name:
Anonymous
2010-08-16 14:39
>>312
Oh, right. Thanks so much for clearing that up. But it's still not “
just like NOP” in that they both do different things. And please, stop telling me to copulate with anal excretions.
316
Name:
Anonymous
2010-08-16 14:58
Why are we discussing a toy logic gate.
317
Name:
Anonymous
2010-08-16 15:02
In before the XARN gate.
318
Name:
Anonymous
2010-08-16 15:27
>>317
A B | out
-----+----
0 0 | 1
0 1 | 1
1 0 | 0
1 1 | Python
319
Name:
Anonymous
2010-08-16 15:45
>>318
A B | out
-----+----
0 0 | 1
0 1 | 1
1 0 | 0
1 1 | Forced
Indentation
Of
Code
Thread over.
320
Name:
Anonymous
2010-08-16 16:01
*
A B | out
-----+----
0 0 | 1
0 1 | 1
1 0 | 0
1 1 | You're an idiot.
Newer Posts