Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-120121-160161-200201-240241-280281-320321-360361-

ITT the ABC Programming Language

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");
  }
}

Name: Anonymous 2008-07-29 19:32

It's called a ``buffer''

Name: Anonymous 2008-07-29 19:39

>>2
No, a BUFFA.

Name: Anonymous 2008-07-29 19:45

else printf("%s","Error.\n");

Name: Anonymous 2008-07-29 21:18


aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaa
aaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbcaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbcaaaaaaaaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbbbbcbbbbcaaacb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbbbbbb
bbbbbcacaaaaaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbcaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbbbbcbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaacbbbbbcaaaaaaccaaaaaaaacaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc


USE ASCII

Name: Anonymous 2008-07-30 14:00

Is no-one going to correct him?

Name: Anonymous 2008-07-30 14:01

BUFFA BUFFA BUFFA BUFFA BUFFA

Name: Anonymous 2008-07-30 14:05

Maybe he intended to use ``BUFFB'' and ``BUFFC''.

Name: Anonymous 2008-07-30 14:41

buffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffcbuffbuffabuffbuffabuffbuffabuffbuffabuffbuffabuffbuffa

Name: Anonymous 2008-07-30 15:17

GET TO DA BUFFA

Name: Anonymous 2008-07-30 17:51

I <3 ABC

Name: Anonymous 2008-07-30 18:18

i never gets incremented.

Name: Anonymous 2008-07-30 18:21

>>12
That's not the only problem.

Name: Anonymous 2008-07-30 18:24

>>13
BUFFA is not initialized and argv[argc] is not guaranteed to be '\0'?

Name: Anonymous 2008-07-30 18:27

>>14
Correction: argv[argc] is guaranteed to be NULL.

Name: Anonymous 2008-07-30 18:36

>>14
There are even more problems.

Name: Anonymous 2008-07-30 18:45

>>>char argv*[]
what

Name: Anonymous 2008-07-30 19:31

>>14
6/10

Name: Anonymous 2008-07-30 21:18

perl -ne"/a/?$,++:/b/?$,--:/c/&&print chr$,for split//"

Name: Anonymous 2008-07-30 21:28

>>2
HEY KID, IMA COMPUTA

Name: Anonymous 2008-07-30 23:06


prog = raw_input('>')
acc = 0
for i in prog:
    if i == a:
        acc += 1
    if i == b:
        acc -= 1
    if i == c
        print acc,

Name: Anonymous 2008-07-31 0:07

if i == c
what.

Name: Anonymous 2008-07-31 1:10

>>21
Barewords are the same thing as chars now?

Name: Anonymous 2008-07-31 2:57

>>23
Someone obviously never forcefully indented their code.

Name: Anonymous 2008-07-31 3:09

>>24
forcibly

Name: Anonymous 2008-07-31 4:31

Anyways, >>25, please listen to me. That it's really related to this thread.
I went to Yoshinoya a while ago; you know, Yoshinoya?
Well anyways there was an insane number of people there, and I couldn't get in.
Then, I looked at the banner hanging from the ceiling, and it had "150 yen off" written on it.
Oh, the stupidity. Those idiots.
You, don't come to Yoshinoya just because it's 150 yen off, fool.
It's only 150 yen, 1-5-0 YEN for crying out loud.
There're even entire families here. Family of 4, all out for some Yoshinoya, huh? How fucking nice.
"Alright, daddy's gonna order the extra-large." God I can't bear to watch.
You people, I'll give you 150 yen if you get out of those seats.
Yosinoya should be a bloody place.
That tense atmosphere, where two guys on opposite sides of the U-shaped table can start a fight at any time,
the stab-or-be-stabbed mentality, that's what's great about this place.
Women and children should screw off and stay home.
Anyways, I was about to start eating, and then the bastard beside me goes "extra-large, with extra sauce."
Who in the world orders extra sauce nowadays, you moron?
I want to ask him, "do you REALLY want to eat it with extra sauce?"
I want to interrogate him. I want to interrogate him for roughly an hour.
Are you sure you don't just want to try saying "extra sauce"?
Coming from a Yoshinoya veteran such as myself, the latest trend among us vets is this, extra green onion.
That's right, extra green onion. This is the vet's way of eating.
Extra green onion means more green onion than sauce. But on the other hand the price is a tad higher. This is the key.
And then, it's delicious. This is unbeatable.
However, if you order this then there is danger that you'll be marked by the employees from next time on; it's a double-edged sword.
I can't recommend it to amateurs.
What this all really means, though, is that you, >>1, should just stick with today's special.

Name: Anonymous 2008-07-31 4:50

        ___
    /´. _, -―-、ヽ、
  ./  l´[☆ィTfヘマ、 ヽ
 |  | |ィケリノ |ト}!l|
 | _| レァ予  伝yリ|    ,..、
  | fr| 《{_丿   Ljハ∥  _,ノ/`il  / 
  | ゞ||'''  r‐ァ`,ツイイ´  ハ il      You all suck.
 |  | 「`}T 云'I「|{ {::::{   V リ  \
 || N {`ヾー弋イノ`衣√`ヾノ
  从 | l! Y   Qヘ\イ乍}
    `ヽハ l〉    Y´ア´
      レ´       「´

Name: Anonymous 2008-07-31 5:23

>>24
I have. Have you?

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
NameError: name 'a' is not defined

Name: Anonymous 2008-07-31 8:56

>>28
import nakedchars

Name: Anonymous 2008-07-31 11:03

>>21

prog = raw_input('>')
acc = 0
for i in prog:
    if i == 'a':
        acc += 1
    if i == 'b':
        acc -= 1
    if i == 'c':
        print acc,

Name: Anonymous 2008-07-31 11:13

self = lambda s, i=0: s != '' and self(s[1:], {'a': lambda x: x + 1, 'b': lambda x: x - 1, 'c': lambda x: __import__('sys').stdout.write(str(x))}.get(s[0], lambda x: x)(i))
self(raw_input('>'))

Name: Anonymous 2008-07-31 12:13

>>30
Every time I see FIOC code, I ask myself ``So clean… Isn't that HASKELL?''. But then I realise that it's FIOC and I think that haskellites and pythonistae should be friends.

Name: Anonymous 2008-07-31 12:15

>>31
Every time I see FIOC code, I ask myself ``So clean… Isn't that LISP?''. But then I realise that it's FIOC and I think that lispellites and pythonistae should be friends.

Name: Anonymous 2008-07-31 12:19

>>33
Did you just call (((LISP))) ``clean''?

Name: Anonymous 2008-07-31 12:28

>>34
(((((((lol))))))()()()()()())((()))())()))))()()(()))()()()())))))((()))()))()()))(())())))()((lol)))

Name: Anonymous 2008-07-31 12:28

>>34
It is. Little pearls of code. :3

Name: Anonymous 2008-07-31 12:32

>>36
It is. Little nuggets of shit. :3
Fixed.

Name: Anonymous 2008-07-31 13:31

Seriously I can't believe none of you have picked up on the most obvious problem.

Name: Anonymous 2008-07-31 13:41

>>38
I have.

Name: Anonymous 2008-07-31 13:56

>>38
Using sepples instead of Java?

Name: Anonymous 2008-07-31 15:32

>>38
Yes, you fail at equality versus assignment and you don't know how to increment a loop variable, but those are the least of your problems.

Name: Anonymous 2008-07-31 15:56

>>41
I am never telling you jokes again.

Name: Anonymous 2008-07-31 16:29

>>42
There was no joke.
You are a joke.

Name: Anonymous 2008-07-31 18:27

>>43
You are a yoke.

Name: 2008-07-31 20:17

Name: Anonymous 2008-08-01 9:56


#include "stdafx.h"
#include "stdio.h"
#include "iostream"
#include <string>

int _tmain(int argc, _TCHAR* argv[])
{
    int i = 0;
    int buffer = 0;

    std::string input ="";

    std::cout << "Please enter ABC String: ";
    std::cin >> input;
    std::string::iterator theIterator;
    theIterator = input.begin();
    while(theIterator != input.end()){
        if(*theIterator == 'a')
            buffer++;
        else if(*theIterator == 'b')
            buffer--;
        else if(*theIterator == 'c')
            printf("%i\n",buffer);
        else printf("%s","Error.\n");
            theIterator++;
    }
    return 0;
}

Name: Anonymous 2008-08-01 9:57

>>46
Ups. int i = 0; not needed. Copy&Paste error.

Name: Anonymous 2008-08-01 10:13


#include "stdafx.h"
#include "iostream"
#include <string>

int _tmain(int argc, _TCHAR* argv[])
{
    int buffer = 0;

    std::string input ="";

    std::cout << "Please enter ABC String: ";
    std::cin >> input;
    std::string::iterator theIterator;
    theIterator = input.begin();
    while(theIterator != input.end()){
        if(*theIterator == 'a')
            buffer++;
        else if(*theIterator == 'b')
            buffer--;
        else if(*theIterator == 'c')
            std::cout << buffer << std::endl;
        else std::cout << "Error.\n";
            theIterator++;
    }
    return 0;
}


Fixed.

Name: Anonymous 2008-08-01 10:14

>>46 has successfully upgraded >>1 to C++.

Name: Anonymous 2008-08-01 10:48

&:!vv-1:_$>\:v       
@.1_>:  ^ ^ *_$.@

Name: Anonymous 2008-08-01 11:22

>>50
0&:!v>:1-:v v*\_$.@
@.1 _^    _$>\:^

Name: Anonymous 2008-08-01 11:27

>>51
Why did you post a longer version? That makes no sense.

Name: Anonymous 2008-08-01 11:36

ABC has nine commands, people, not three.

public class ABCInterpreter {
    public static void main (String[] args) {
        for (int i = 0; i < args.length; i++) {
            boolean ascii = false;
            int BUFFA = 0;

            for (int j = 0; j < args[i].length(); j++) {
                switch (args[i].charAt(j)) {
                    case 'a':
                        BUFFA++;
                        break;
                    case 'b':
                        BUFFA--;
                        break;
                    case 'c':
                        System.out.print(ascii ? (char) BUFFA
                                               : BUFFA);
                        break;
                    case 'd':
                        System.err.println("I have no idea what 'invert' means");
                        break;
                    case 'r':
                        BUFFA = new java.util.Random().nextInt(BUFFA);
                        break;
                    case 'n':
                        BUFFA = 0;
                        break;
                    case '$':
                        ascii = !ascii;
                        break;
                    case 'l':
                        i = 0;
                        break;
                    case ';':
                        System.out.println("\n" + (char) BUFFA
                                           + " " + BUFFA);
                        break;
                    default:
                        System.err.println("Unknown command: " +
                                           args[i].charAt(j));
                }
            }
        }
        System.out.println("");
    }
}

Name: Anonymous 2008-08-01 11:57

>>53
System.err.println("I have no idea what 'invert' means");

BUFFA *= -1;

Name: Anonymous 2008-08-01 12:08

>>53

GOD
  DAMN
    JAVA;

Name: !WokonZwxw2 2008-08-01 12:20

I am Wokon and I support The ABC Programming Language.

Name: Anonymous 2008-08-01 12:39

>>54
System.err.println("I have no idea what 'invert' means");
> BUFFA *= -1;
BUFFA = 1 / BUFFA;

Name: Anonymous 2008-08-01 12:50

>>52
It's /prog/, people prefer HASKELL over C here. Don't talk to me about sense.

Name: Anonymous 2008-08-01 13:21

A FULL implementation of The ABC Programming Language in the Algorithmic Language:
(define (abc source)
  (define accumulator 0)
  (define ascii #f)
  (define (interpret i)
    (cond ((char-ci=? i #\a) (set! accumulator (+ 1 accumulator)))
          ((char-ci=? i #\b) (set! accumulator (- 1 accumulator)))
          ((char-ci=? i #\c) (display (if (eq? #t ascii)
                                          (integer->char accumulator)
                                          accumulator)))
          ((char-ci=? i #\d) (set! accumulator (* (- 1) accumulator)))
          ((char-ci=? i #\r) (set! accumulator (random accumulator)))
          ((char-ci=? i #\n) (set! accumulator 0))
          ((char-ci=? i #\$) (set! ascii (not ascii)))
          ((char-ci=? i #\l) (run))
          ((char-ci=? i #\;) (display accumulator)
                             (display (integer->char accumulator)))))
  (define (run)
    (for-each interpret (string->list source))
    (newline))
  (run))

Name: Anonymous 2008-08-01 13:32

>>53
>System.err.println("I have no idea what 'invert' means");
That's because you're a JAVAIDS programmer.

Name: Anonymous 2008-08-01 13:32

>>59
(- 1 accumulator)
You may want to check that.

Name: Anonymous 2008-08-01 13:33

>>60
That's because ``invert'' can have a million meanings.

Name: Anonymous 2008-08-01 13:34

>>62
You should have checked the esolang wiki and looked at the reference implementation, then.  JAVAIDS has bloated your mind!

Name: Anonymous 2008-08-01 13:38


#include "stdafx.h"
#include "iostream"
#include <string>
#include "stdlib.h"
#include "time.h"

int _tmain(int argc, _TCHAR* argv[])
{
    int buffer = 0;
    bool ascii = false;

    std::string input ="";

    std::cout << "Please enter ABC String: ";
    std::cin >> input;
    std::string::iterator theIterator;
    theIterator = input.begin();
    srand( (unsigned) time(NULL) );
    while(theIterator != input.end()){
        if(*theIterator == 'a')
            buffer++;
        else if(*theIterator == 'b')
            buffer--;
        else if(*theIterator == 'c'){
            if(ascii)
                std::cout << (char)buffer << std::endl;
            else
                std::cout << buffer << std::endl;}
        else if(*theIterator == 'd')
            buffer=-1*buffer;//Or whatever it means.
        else if(*theIterator == 'r'){
            buffer = 0 + (rand() % (buffer+1));}
        else if(*theIterator == 'n')
            buffer=0;
        else if(*theIterator == 'l')
            theIterator = input.begin();
        else if(*theIterator == '$'){
            if (ascii)
                ascii=false;
            else
                ascii=true;}
        else if(*theIterator == ';'){
                std::cout << (char)buffer << std::endl;
                std::cout << buffer << std::endl;}
        else
            std::cout << "Error.\n";
        if(*theIterator != 'l')
            theIterator++;
    }
    return 0;
}

Name: Anonymous 2008-08-01 13:39

>>61
Good catch!  Introducing the Revised Algorithmic Implementation of The ABC Programming Language.  Also added to the test suite: (abc "bbc")
(define (abc source)
  (define accumulator 0)
  (define ascii #f)
  (define (interpret i)
    (cond ((char-ci=? i #\a) (set! accumulator (+ 1 accumulator)))
          ((char-ci=? i #\b) (set! accumulator (- accumulator 1)))
          ((char-ci=? i #\c) (display (if (eq? #t ascii)
                                          (integer->char accumulator)
                                          accumulator)))
          ((char-ci=? i #\d) (set! accumulator (* (- 1) accumulator)))
          ((char-ci=? i #\r) (set! accumulator (random accumulator)))
          ((char-ci=? i #\n) (set! accumulator 0))
          ((char-ci=? i #\$) (set! ascii (not ascii)))
          ((char-ci=? i #\l) (run))
          ((char-ci=? i #\;) (display accumulator)
                             (display (integer->char accumulator)))))
  (define (run)
    (for-each interpret (string->list source))
    (newline))
  (run))

Name: Anonymous 2008-08-01 13:41


1 REM THE ABC PROGRAMMING LANGUAGE
10 INPUT">";P$
20 FOR I=0 TO LEN(P$)
30 I$=MID$(P$,1,I)
40 IF I$="A" THEN A=A+1
50 IF I$="B" THEN A=A-1
60 IF I$="C" THEN PRINT A;
70 NEXT I
80 PRINT:PRINT"END.":PRINT

Name: Anonymous 2008-08-01 13:42

>>63
The ``reference implementation'' is a 404'd PHP script.
I did test all the examples listed in the article, though, and they all checked out. None of them used d, though.

Name: Anonymous 2008-08-01 13:45

>>67

Random phone number generator:

ac
naaaaaaaaradc
naaaaaaaaarc
naaaaaaaaarc

naaaaaaaaradc
naaaaaaaaarc
naaaaaaaaarc

naaaaaaaaradc
naaaaaaaaarc
naaaaaaaaarc
naaaaaaaaarc



AHEM.

Name: Anonymous 2008-08-01 13:50

>>67
It's not a 404 for me (or wasn't earlier - it seems /prog/ is bogging down their server)...  Way to go guys!

Name: Anonymous 2008-08-01 13:58

>>68
That's hardly unambiguous!

Name: Anonymous 2008-08-01 14:10

>>70
Until you actually run the program...
> (abc (string-append "ac"
                    "naaaaaaaaradc"
                    "naaaaaaaaarc"
                    "naaaaaaaaarc"                   
                    "naaaaaaaaradc"
                    "naaaaaaaaarc"
                    "naaaaaaaaarc"
                    "naaaaaaaaradc"
                    "naaaaaaaaarc"
                    "naaaaaaaaarc"
                    "naaaaaaaaarc"))
1-327-261-6454

Name: Anonymous 2008-08-01 14:54

Lets roll some dice!

aaaaaracnl

Name: Anonymous 2008-08-01 14:55

abc n (x:xs) = case x of { 'a' -> abc (n+1) xs ; 'b' -> abc (n-1) xs ; 'c' -> ((putChar.toEnum) n >> abc n xs) ; _ -> abc n xs } ; abc _ _ = putStrLn ""

Name: Anonymous 2008-08-01 14:57

>>73
Please use the indentation and code tags.

Name: Anonymous 2008-08-01 15:00

>>74
I won't allow the indentation to be forced on me !!

Name: Anonymous 2008-08-01 15:02

>>73

abc n (x:xs) =
    case x of
      'a' -> abc (n+1) xs
      'b' -> abc (n-1) xs
      'c' -> ((putChar.toEnum) n >> abc n xs)
      _ -> abc n xs }
abc _ _ = putStrLn ""

Name: Anonymous 2008-08-01 15:16


abc :: [Char] -> IO ()
abc = abc' 0

abc' :: Int -> [Char] -> IO ()
abc' n (x:xs) =
    case x of
      'a' -> abc' (n+1) xs
      'b' -> abc' (n-1) xs
      'c' -> ((putChar.toEnum) n >> abc' n xs)
      _ -> abc' n xs
abc' _ _ = putStrLn ""

gen :: [Char] -> [Char]
gen = gen' 0

gen' :: Int -> [Char] -> [Char]
gen' n (x:xs) =
    let
        c = fromEnum x
        abc | (c > n) = take (c-n) $ repeat 'a'
            | (c < n) = take (n-c) $ repeat 'b'
            | c == n  = ""
    in
      abc ++ ('c' : gen' c xs)
gen' _ _ = ""


It looks like fucking sepples, but I'm too tired to improve it

Name: Anonymous 2008-08-01 15:18

I haven't seen many ABC programs yet.  Only implementations.

Name: Anonymous 2008-08-01 16:03

>>78
[obvious]
That's because ABC isn't Touring complete.
It can only output letters.
[/obvious]

Name: Anonymous 2008-08-01 16:32

>>79
Also numbers.

Name: Anonymous 2008-08-01 16:35

>>80
Also commas and parentheses.  But it's not terribly useful for reasons other than steganography.

Name: Anonymous 2008-08-01 16:36

>>81
Also butts.

Name: Anonymous 2008-08-01 16:50

hax my butts

Name: Anonymous 2008-08-01 20:19

>>78
Only gcc has been ported so far.

Name: Anonymous 2008-08-01 21:11

>>82
hax my anus

Name: Anonymous 2008-08-01 21:53

A vision from The Sussman came to me, and he told me what I was doing was Good but that I could do Better.  May he enjoy this RevisedThe Second The ABC Programming Language Algorithmic Implementation:
(define (abc source)
  (define accumulator 0)
  (define ascii #f)
  (define (interpret i)
    (case i
      ((#\a) (set! accumulator (+ 1 accumulator)))
      ((#\b) (set! accumulator (- accumulator 1)))
      ((#\c) (display (if ascii
                          (integer->char accumulator)
                          accumulator)))
      ((#\d) (set! accumulator (- accumulator)))
      ((#\r) (set! accumulator (random accumulator)))
      ((#\n) (set! accumulator 0))
      ((#\$) (set! ascii (not ascii)))
      ((#\l) (run))
      ((#\;) (display accumulator)
             (display (integer->char accumulator)))))
  (define (run)
    (for-each interpret (map char-downcase (string->list source)))
    (newline))
  (run))

Name: Anonymous 2008-08-01 21:58

I love you

Name: Anonymous 2008-08-01 21:59

>>86
A vision from The Sussman came to me, and he told me what I was doing was Good but that I could do Better.
No, that was Star Wolf.

Name: Anonymous 2008-08-01 22:19

>>88
I can't let you do that Star Fox

Name: Anonymous 2008-08-02 8:00

>>86
This is pleasant to the eye, both in BBcode and LISP content. I am quite satisfied to be posting on this board with you and the Sussman.

Name: Anonymous 2008-08-02 9:04

>>86,87,90
Same faggot. Go suck nigger cocks.

Name: Anonymous 2008-08-02 13:28

>>91
back to/b/please.

Name: Anonymous 2008-08-02 19:08

>>93
SHUT UP

Name: Anonymous 2008-08-02 19:34

The one path to zen is thus;

a

Name: Anonymous 2008-08-02 19:54

+[>+]

Name: Anonymous 2008-08-02 21:31

>>95
I think you mean
al

Name: Anonymous 2008-08-02 23:35

THIS HAVE BEEN THE BEST THREAD ON/prog/ IN A WHILE

Name: Anonymous 2008-08-03 0:05

>>97
I lol'd at BUFFA
Otherwise thread sux

Name: Anonymous 2008-08-03 2:01

ABC sucks, let's do Brainfuck instead

Name: Anonymous 2008-08-03 2:16

Brainfuck has been done even more than ABC.  We should do something different.

Name: Anonymous 2008-08-03 4:47

>>100
Lets's do C++ in C

Name: Anonymous 2008-08-03 6:06

>>101
That's different, how, exactly?

Name: Anonymous 2008-08-03 8:32

>>100
Brainfuck to C is even on the Brainfuck wiki page...

Name: Anonymous 2008-08-03 10:32

>>103
But not C to Brainfuck.

Name: Anonymous 2008-08-03 10:38

>>104
lol

Name: Anonymous 2008-08-03 11:17

You may laugh, but work is undergoing1 on a C to Befunge compiler.
_________________
1In the very loosest sense of the word `undergoing'2
2J^4: C-to-Befunge compiler. Lee, J. http://www.phlamethrower.co.uk/befunge/c2b.php. Modified March 23, 2008; Retrieved August 3, 2008.

Name: Anonymous 2008-08-03 18:54

This thread is about the ABC programming language, for newcomers to the discussion :)

Name: Anonymous 2008-08-03 19:00

>>107
This thread was about the ABC programming language.

Name: Anonymous 2008-08-03 23:25

This thread is about the ABC programming language.

Name: Anonymous 2008-08-03 23:33

>>109
Welcome to about 50 posts ago. I don't think you know what this thread is about.

Name: Anonymous 2008-08-04 0:18


   人     
  (__)    
  (__)   
 ( __ )    
 ( ・∀・) < Let's add control structures to ABC
 (つ   つ 
 | | |     
 (__)_)

Name: Anonymous 2008-08-04 6:27

In b4 the ABCD Programming Language

Name: Anonymous 2008-08-04 8:26

In b4 ABC++

Name: Anonymous 2008-08-04 8:28

In b4 ABC++

Name: Anonymous 2008-08-04 8:28

ABSEPPLESD

Name: Anonymous 2008-08-04 8:41

>>114
TOO LATE

Name: Anonymous 2008-08-04 9:44

AY-BEE-SEPPLES

Name: Anonymous 2008-08-04 9:52

I infused an apple with tin.

I call it a snapple.

Name: Anonymous 2008-08-04 10:05

Name: Anonymous 2008-08-04 10:08

>>118
Why don't you write about it in your web comic?

Name: Anonymous 2008-08-04 11:54

if you missed the PHP reference implementation here it is:
<?php
if (substr(php_sapi_name(), 0, 3) != 'cli') show_source(__FILE__) xor die();
$prog=file_get_contents("php://stdin");
$ascii=false;
$acc=0;
for($i=0;$i<strlen($prog);$i++) {
  $c=$prog[$i];
  switch($c) {
    case 'a': $acc++; break;
    case 'b': $acc--; break;
    case 'c': if($ascii) echo chr($acc); else echo $acc; break;
    case 'd': $acc*=-1; break;
    case 'r': $acc=mt_rand(0,$acc); break;
    case 'n': $acc=0; break;
    case '$': $ascii=!$ascii; break;
    case 'l': $i=-1; break;
    case ';': echo $acc.chr($acc); break;
  }
}

Name: Anonymous 2008-08-04 12:54

rather then adding another letter to the ABC Programming Language to handle control structures how about taking an ascii control character that never gets used and make it an escape character for the sequence that defines the branch

Name: Anonymous 2008-08-04 12:57

then

Name: Anonymous 2008-08-04 12:58

<gibberish>

Name: Anonymous 2008-08-04 21:24

>>122
Holy fuck you're evil

Name: Anonymous 2008-08-04 22:08

This is the only thread active on /prog/ with source code in the first post :(

Name: Anonymous 2008-08-04 22:26

>>126
That's depressing (although not new)

Name: Anonymous 2008-08-04 22:27

128GET

Name: Anonymous 2008-08-05 9:20

>>126
There's more programming discussion on /prog/ right now than there has been in many months.

Name: Anonymous 2008-08-05 11:38

Even if it IS an esoteric one.

Name: Anonymous 2008-08-05 13:42

Name: Anonymous 2008-08-05 13:59

I write that PHP implementation, even though I didn't make that program language ABC. Does it still a reference implementation? I guess it is if User:Orange decides it to be.

Name: Anonymous 2008-08-05 18:59

looks pretty much like a knockoff version of Brainfuck to me...

Name: Anonymous 2008-08-06 1:05

I'm surprised no one even touched the wiki page.

Name: Anonymous 2008-08-06 6:49

You didn't look very closely (or too soon, whatever)

Name: Anonymous 2008-08-06 6:50

Apparently Orange himself visits /prog/ and linked to this thread

Name: Anonymous 2008-08-06 8:35

>>136
Then there's only two possibilities: either you're User:Orange, or the Sussman invented the ABC programming language.

Name: Anonymous 2008-08-06 8:54

>>137
I assure you, GJS never touched this faggotry.

Name: Anonymous 2008-08-06 9:12

>>137
Your logic is infallible!

Name: Anonymous 2008-08-06 10:38

    #!/usr/bin/perl
    $_=<>;$i=0;s/a/$i++;/g;s/b/$i--;/g;s/c/print$i,"\n";/g;eval$_

Name: Anonymous 2008-08-06 10:39

fucking bbcode


#!/usr/bin/perl
$_=<>;$i=0;s/a/$i++;/g;s/b/$i--;/g;s/c/print$i,"\n";/g;eval$_

Name: Anonymous 2008-08-06 12:33

This thread still lacks compiler.

#!/usr/bin/perl

$pre = <<EOF;
#include <stdio.h>

int main()
{
    int acc = 0, asc = 0;
EOF

$pre_rand = <<EOF;
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int acc = 0, asc = 0;
    srandomdev();
EOF

$post = <<EOF;
    putchar('\\n');
}
EOF

$post_loop = <<EOF;
    }
}
EOF

%ops = (
    a => 'acc++',
    b => 'acc--',
    c => 'asc ? putchar(acc) : printf("%d", acc)',
    d => 'acc = -acc',
    r => 'acc = random() % (acc+1)',
    n => 'acc = 0',
    '$'=>'asc = !asc',
    ';'=>'printf("%d%c", acc, (char)acc)'
);

sub compile {
    my ($abc) = @_;
   
    die "Syntax error: unrecognized operator $1 at char $+[1]\n"
        if $abc =~ /([^abcdrn\$l;\s])/;
    warn "Unreachable code detected at char @{[$-[1]+(1)]}: $1\n"
        if $abc =~ /l\s*(\S+.*)/s;
   
    $abc =~ s/\s+//g;
    $has_rand = $abc =~ /r/;
    $has_loop = $abc =~ s/l.*//;
    $indent = "\t" . "\t" x $has_loop;
   
    (my $c = $abc) =~ s/(.)/$indent.$ops{$1}.";\n"/ge;
    $c = ($has_rand ? $pre_rand : $pre) .
         ($has_loop ? "\tfor(;;)\n\t{\n" : "") .
         $c .
         ($has_loop ? $post_loop : $post);
}

undef $/;
print compile <>;

Name: Anonymous 2008-08-06 12:54

This thread is made of win.

Name: Anonymous 2008-08-06 18:44

/prog/ ABC Interpreter and Compiler Suite
I came.

Name: Anonymous 2008-08-06 18:59

>>144

I lol'd irl

Name: Anonymous 2008-08-07 11:06

>>106

Gregor Richards has written one (http://esolangs.org/wiki/C2BF) and libbf has one (http://savannah.nongnu.org/projects/libbf).

Name: Anonymous 2008-08-11 12:12

i <3 sicp girl

Name: Anonymous 2008-08-13 13:29

Where is the ABCIDE?

Name: Anonymous 2008-08-13 13:53

>>148
All of the core developers are using vim, and I imagine most of our userbase is too.

Name: Anonymous 2008-08-26 2:08

150

Name: Anonymous 2008-08-26 3:02

You could do it like php with <?abc ?> tags - ABC outside of the tags would be printed to stdout and ABC inside of the tags would be instructions for an interpreter/opcodes for a vm.

Name: Anonymous 2008-08-26 6:37

>>151
Let's not emulate the worst language in mainstream use today, for a change.

Name: Anonymous 2008-08-26 11:35

>>152
Second worst, after this takes off.

Name: Anonymous 2008-08-26 15:00

>>152
The worst language in mainstream use? Ordered from ">>154 ain't doing that shit" to ">>154 will do that":

1. COBOL
2. Sepples
3. Visual Basic
4. Java
5. C
6. C#
7. PHP

And of course, >>154 will most happily do FIOC.

Name: Anonymous 2008-08-26 15:03

>>154
fixed

1. COBOL
2. PHP
3. Sepples
4. Visual Basic
5. C
6. Java
7. C#
8. BBCode

Name: Anonymous 2008-09-21 8:53

Name: Anonymous 2008-09-21 9:21

>>154
lol@PHP on top. Faggot.

>>155
lol@C# and Java over C. Faggot.

Name: Anonymous 2008-09-21 9:55

>>155,157
I'd much rather do PHP than Sepples, Visual Basic, Java, and probably C and C#. PHP's standard library sucks, but the language itself is dynamically-typed, simple, and cleaner than Perl and Ruby (though dirtier than most others), and it's getting first-class functions and anonymous closures in 5.3.

Name: Anonymous 2008-09-21 10:52

>>158
Will it have lexical scoping in 5.3 as well?

Name: Anonymous 2008-09-21 12:22

>>153
You have given me a new purpose in life. I will create a programming language that is worse than PHP.

Name: Anonymous 2008-09-21 12:37

>>160
That's simple. Just try to fix PHP.

Name: Anonymous 2008-09-21 15:38

ITT the ATS programming language

Name: Anonymous 2008-09-21 17:32

>>162

    #include <stdio.h>

    int main(int argc,char *argv[]){
      int i = 1;
      int bi = 0;
      int x,what;
      int* BUFFA;

      while(argv[i]!='\0'){
        if(argv[i]=='a'){
          BUFFA[bi]=1;
          bi++;
        }
        else if(argv[i]=='t'){
          BUFFA[bi]=-1;
          bi++;
        }
        else if(argv[i]=='s'){
          what=0;
          for(x=0;x<128;++x){
            what+=BUFFA[bi-x];
          }
          what+=128;
          printf("%c",what);
        }
        else printf("%s","Error.\n");
      }
    }

Name: Anonymous 2008-09-21 20:01

BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA

Name: Anonymous 2008-09-22 0:24

>>164
GET IN THE BUFFA!

Name: Anonymous 2008-09-22 11:35

GET IN T[i]HE BUFFB

Name: Anonymous 2008-09-22 12:00

................................................................................................................................................................................

Name: Anonymous 2008-09-22 17:24

OH MY GOD ITS A PUSH GET IN THE BUFFA

Name: Anonymous 2008-09-22 19:26

Hey folks.  I have a fun project for you.

First, take a line of text.  Run it through a Text to ABC program.

C:\Documents and Settings\XXXXXXXXXX\Desktop>text2abc.py Read SICP.  The Sussman
 Thanks you!
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
caaaaaaaaaaaaaaaaaaacbbbbcaaacbbbbbbbbbbb
bbbbbbcbbbbbbbbbbcbbbbbbcaaaaaaaaaaaaacbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaa
aaaaaaaaaacbbbcbbbbbbbbbbbbbbbbbbcaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaacbbccbbbbbbcbb
bbbbbbbbbbcaaaaaaaaaaaaacbbbbbbbbbbbbbbbb
bbbbbbbbbbcaaaaaaaaaaaaaaaaaaaacbbbbbbbca
aaaaaaaaaaaacbbbcaaaaaaaacaaaaaacbbbbbbbb
bbcaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbc



Replace all the a and b's with spaces.

                                        
                                        
c                   c    c   c          
      c          c      c             c 
                                c       
                              c         
          c   c                  c      
                           c  cc      c 
          c             c               
          c                    c       c
            c   c        c      c       
  c      c                              
                                        
            c


What do you see?

I see a shrimp in this one.

                                        
                                        
c                   c    c   c          
      c          c      c             c  antena
                                c       
                              c         
 tail     c   c                  c      
                           c  cc      c 
          c             c               
          c                    c       c
            c   c        c      c       
  c      c                              
                               legs     
            c




I found a dog once.

Name: Anonymous 2008-09-22 19:51

I see forever.

Name: Anonymous 2008-09-22 22:42

>>169
Mind Fuck

Name: Anonymous 2008-09-23 0:35

>>169
Was the dog you saw Haskell?

Name: Anonymous 2008-09-23 0:47

>>169
Was the dog you saw Haskell?

Name: Anonymous 2008-09-23 9:39

$ ./abccc.pl | cc -o 169 -Os -xc -
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
caaaaaaaaaaaaaaaaaaacbbbbcaaacbbbbbbbbbbb
bbbbbbcbbbbbbbbbbcbbbbbbcaaaaaaaaaaaaacbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaa
aaaaaaaaaacbbbcbbbbbbbbbbbbbbbbbbcaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaacbbccbbbbbbcbb
bbbbbbbbbbcaaaaaaaaaaaaacbbbbbbbbbbbbbbbb
bbbbbbbbbbcaaaaaaaaaaaaaaaaaaaacbbbbbbbca
aaaaaaaaaaaacbbbcaaaaaaaacaaaaaacbbbbbbbb
bbcaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbc
$ ./169
82101971008373678046841041018311711511510997110841049711010711512111111733

Name: Anonymous 2008-09-23 19:29

EXPERT ABC CODER

Name: Anonymous 2008-09-24 0:12

SCALABLE BUFFA SOLUTIONS

Name: Orange 2008-10-13 16:19

Thanks

Name: Anonymous 2008-10-27 11:22

Please stop bumping this thread.

Name: Anonymous 2008-10-27 12:11

Please stop buffa BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA BUFFA

Name: Bro 2008-10-27 13:26

Bro, stop bumping, bro.

Name: Anonymous 2008-10-27 14:09

I don't understand what's wrong with this code.

Name: Anonymous 2008-10-27 15:16

GET TO THE BUFFFA

Name: Anonymous 2008-10-27 16:09

ITT: /prog/ releases open source software.


/* abc.c: an ABC interpreter. Released into the public domain. */

#include <stdio.h>
#include <string.h>
#include <malloc.h>

int main(int argc, char* argv[])
{
    printf("ABC interpreter v0.0.1a by /prog/\n\n");
    if(argc < 2)
    {
        fprintf(stderr, "Error: no program text.\n\nUsage: %s [program text]\n", argv[0]);
        return 1;
    }
    else if(argc > 2)
    {
        fprintf(stderr, "Warning: more than 1 argument detected, ignoring trailing arguments.\n");
    }

    int acc = 0;
    int l = strlen(argv[1]);
    int i;
    for(i = 0; i < l; i++)
    {
        if    (argv[1][i] == 'a') { acc++; }
        else if    (argv[1][i] == 'b') { acc--; }
        else if (argv[1][i] == 'c') { printf("%d\n", acc); }
        else
        {
            printf("Error:c%d:unrecognised character.\n", i);

            /* print line that error was on, and underneath put a ^ to indicate what char we can't parse */
            char* progstr = malloc(i * sizeof(char) + 1);
            int j;
            for(j = 0; j <= i; j++)               
            {
                progstr[j] = argv[1][j];
            }
            progstr[i + 1] = '\0';

            char arrowstr[i + 1];
            int k;
            for(k = 0; k < i; k++)
            {
                arrowstr[k] = ' ';
            }
            arrowstr[i] = '^'; arrowstr[i + 1] = '\0';

            printf("%s\n", progstr); /* this (rather than just printf(progstr);) is to stop users from putting placeholders in the program string, causing printf() to parse them */
            printf("%s\n", arrowstr);

            return 1;
        }
    }

    return 0;
}

Name: Anonymous 2008-10-27 16:24

>>183
Bug report: it leaks memory, you forgot to free() progstr

Name: Anonymous 2008-10-27 16:58

Has anyone else noticed that this thread is linked to on the esolangs page for ABC
http://esolangs.org/wiki/ABC

Name: Anonymous 2008-10-27 17:46

>>183
You forgot the rest of the instructions, unless of course you're implementing v1 of the language.

Name: Anonymous 2008-10-27 18:30

>>183
Released into the public domain.
http://www.rosenlaw.com/lj16.htm

Name: Anonymous 2008-10-27 20:20

ABC interpreter v0.0.1a by /prog/
I don't want my name on that, and the superior implementations ITT are no less open.

/* this (rather than just printf(progstr);) is to stop users from putting placeholders in the program string, causing printf() to parse them */
I lol'd.

Name: Anonymous 2008-10-28 9:34

>>188

Why the lolling, it's true.

Name: Anonymous 2008-10-28 9:46

>>186

v0.0.1a

Name: Anonymous 2008-10-28 14:55

>>187
Intellectual property enters the public domain only when it grows old.  Everything else, including certainly any computer software of recent vintage, is owned by somebody somewhere.
http://cvs.savannah.gnu.org/viewvc/emacs/lisp/emulation/vi.el?root=emacs&view=markup
;; This file is in the public domain because the authors distributed it
;; without a copyright notice before the US signed the Bern Convention.


ed from 6th edition unix (http://minnie.tuhs.org/UnixTree/V6/usr/source/s1/ed.c.html, 1975) and 7th edition unix (http://minnie.tuhs.org/UnixTree/V7/usr/src/cmd/ed.c.html, 1979) also does not have a copyright notice and was distributed before the US signed the Berne Convention (1989).

...rosen fails at law.

Name: Anonymous 2008-10-28 15:24

>>189

i++; // increment `i' by one because just ``i + 1;'' does not store the result in i


It's true and obvious. You're a retard for thinking otherwise.

Name: Anonymous 2008-10-29 2:34

>>191
Public-domain ed? FUCK YEAH!

Name: Anonymous 2008-10-29 2:43

>>191
The difference there is that it's only in the public domain in the US, not anywhere else. You still can't just release your own software into the public domain.

Also ``recent vintage''.

Name: Anonymous 2008-10-29 3:01

    puts("?");

Name: Anonymous 2008-10-29 6:43

The difference there is that it's only in the public domain in the US, not anywhere else. You still can't just release your own software into the public domain.
it's also public domain in any country with sensible copyright laws (where any work without a copyright notice is in the public domain).

Also ``recent vintage''.
kids these days... 1987 really isn't that old.

Name: Anonymous 2008-10-29 10:43

>>196
sensible copyright laws
where any work without a copyright notice is in the public domain

Wait, what?

Name: Anonymous 2008-10-29 16:41

This thread is threadstopped. You can't reply anymore.

Name: Anonymous 2008-10-29 18:12

I'm depressed this thread has got almost 200 replies.

Is this what prog is reduced to?  Making implementations of crappy toy languages?

Name: Anonymous 2008-10-29 18:18

Why the `Over 1000 Thread ' guy says that ``This thread has over 1000 replies''? The thread has exactly, not over, 1000 posts, of which 999 are replies.

Name: Anonymous 2008-10-29 19:08

>>200
Sometimes it's correct. You can find these quite easily using google. http://dis.4chan.org/read/lounge/1201991937/1002

Name: Anonymous 2008-10-29 20:20

>>197
How hard is it to either plaster a copyright notice over the work or register the work at the national copyright registry?

Name: Anonymous 2008-10-29 20:25

>>199
Goto /pr/ if you want some real programming discussion.
Additonally, the russian /prog/ seems to have adopted most of our memes.

Name: Anonymous 2008-10-29 20:26

>>202
Yay, busy work and a brush with bureaucracy for me. A /prog/rammer should know the value of automation.

Name: Anonymous 2008-10-29 20:47

>>204
You want to invest effort into a work that is to be distributed to the public but are too lazy to watermark a simple symbol in it? If you're that lazy, why bother creating the work at all?

Name: Anonymous 2008-10-29 21:08

>>205
I'm not sure I could explain it to a person who uses the term "work". It's something about doing things that are worthwhile versus pointless red tape. And LOL ON ME if I at some point forget to indicate somewhere on the "work" that I actually would like it to be mine.

Name: Anonymous 2008-10-29 21:50

᷾/proͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦg/ does not work.

Name: Anonymous 2008-10-29 23:17

puts

Name: Anonymous 2008-11-04 18:22

tHi.s tHR.ea..d cAN"t d.ie t*he fu(tUrE dEPE$$nd$s on |t,

Name: Anonymous 2008-11-05 11:56

Stop bumping my thread, thanks. The code is embarrassing.

Name: Anonymous 2008-11-05 15:02

I propose adding a new instruction to ABC to make it turing complete.

Name: Anonymous 2008-11-05 15:23

>>210
Then learn how to code, and don't post your stupid crap on /prog/ until then.

Also, bump.

Name: Anonymous 2008-11-05 15:29

>>212
You're feeding my ego.

Name: Anonymous 2008-11-05 17:56

>>213
Actually, your feeding MY ego.

Name: Anonymous 2008-11-05 20:27

>>214
8/10

Name: Anonymous 2008-11-06 6:17

Actually, this may surprise you but you're feeding my anus.

Name: Anonymous 2008-11-06 6:49

This may surprise you, but I invented the `This may surprise you...' meme.

Name: Anonymous 2008-11-06 16:27

This may surprise you, but this thread is threadstopped. You can't reply any more.

Name: Anonymous 2008-11-06 16:59

>>218
wrong

Name: Anonymous 2008-11-07 1:56

>>219
You broked teh thread, imbecile!

Name: Anonymous 2008-11-09 21:53

[/thread]

Name: Anonymous 2008-11-09 22:15

OK, this time it's stopped for real. >>221 just said so.

Name: Anonymous 2008-11-10 0:22

>>221
Using such powerful BBCode, for such a puny task!

Name: Anonymous 2008-11-21 21:31

BBCode!

Name: Anonymous 2008-11-21 21:31

GET TO THE BUFFA

Name: Anonymous 2008-11-22 13:28

<<225
Thanks for that, I lold

Name: Anonymous 2008-11-23 16:01

>>226
I stole it from earlier in the thread :(

Name: Anonymous 2008-11-23 16:16

<<226
Quote is that way >>.

Name: POOP-ORIENTED PROGRAMMER 2008-11-23 17:27

EVERYONE GET ON THE BUFFA BUS

NEXT STOP FAILVILLE

Name: Anonymous 2008-11-24 10:10

SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS SCALABLE BUFFA SOLUTIONS

Name: Anonymous 2008-11-25 0:04



    #include <stdio.h>

    int main(int argc, char* argc[]){
      int i = 0;
      int BUFFA = 0;

      while(argv[i]!=NULL){
        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");
        i++;
      }
      return 0;
    }

Name: Anonymous 2008-11-25 0:18

>>231
SCALABLE BBCODE FAILURE SOLUTIONS

Name: Anonymous 2008-11-25 0:31

#include <cstdio>
#include <cstdlib>

int main(int argc, char* argv[])
{
    int i = 0;
    int BUFFA = 0;

    while(argv[1][i] != NULL)
    {
        if(argv[1][i] == 'a')
              BUFFA++;
        else if(argv[1][i]=='b')
              BUFFA--;
        else if(argv[1][i]=='c')
              printf("%i\n",BUFFA);
        else printf("%s","Error.\n");
        i++;
      }
      system("PAUSE");
      return 0;
}

Name: User:Orange 2009-05-16 14:19

Hey I remember this thread.

Name: Anonymous 2009-05-16 14:22

>>234
Thanks for the nostalgia ばんぷ

Name: Anonymous 2009-05-16 19:49

Now all we need is an ABC OS

Name: Anonymous 2009-05-17 9:08

>>235
パンツ

Name: >>235 2009-05-17 9:46

>>237
ごめんあさい

Name: Anonymous 2009-05-17 9:55

ダプレズオフビイノグクメドイナサイド

Name: Anonymous 2009-05-17 14:55

グ?

Name: Anonymous 2009-05-17 15:39

>>240
wakarimasen wwww

Name: Anonymous 2009-05-17 17:45

>>239
DAPUREZUOFUBIINOGUKUMEDOINASAIDO
wat

Name: Anonymous 2009-05-18 2:06

貴様たちはあほんだら。

2ちゃん > 4ちゃん”PROG"

Name: Anonymous 2009-05-18 2:07

>>243
Back to Japan, please.

Name: Anonymous 2009-05-18 2:16

>>244
ぬるぽ

Name: Anonymous 2009-05-18 2:17

>>244
Back to you're mother's womb, please.

Name: Anonymous 2009-05-18 2:21

>>246
What about my mother is womb?

Name: Anonymous 2009-05-18 2:26

>>247
It's very womby.

Name: Anonymous 2009-05-18 5:20

>>248
NYJMUW

Name: Trollbot9000 2009-07-01 7:55

The public domain in any country with   sensible copyright laws   where any work   without a copyright   notice is in   the public domain   in any country   with sensible copyright   laws where any   work without a   copyright notice is   in the public   domain because the   authors distributed it.

Name: Anonymous 2009-08-09 22:11

This thread has been threadstopped, you can't reply anymore.

Name: Anonymous 2009-08-09 22:41

>>251
GOD FUCKING DAMN IT I KNEW SOME FAGGOT WOULD FUCKING BUMP THIS

Name: Anonymous 2009-08-09 22:51


b=0
for c in open(__import__('sys').argv[1]).read():
 if c=='a':b+=1
 if c=='b':b-=1
 if c=='c':print b,

B IS F0R BUFFA!!!!!

Name: Anonymous 2009-08-09 23:41

So ABC is just a non functionally pure version of balanced trinary encoding?

Name: Anonymous 2009-08-10 2:01

>>254
No, and I'm pretty sure the only reason anyone would even suggest that is to show off the fact that they know the word ``trinary''.
It's not that impressive, bro.

Name: Anonymous 2009-08-10 10:09

>>253
whats "argv"?

Name: Anonymous 2009-08-10 10:11

>>256
you best be trollin' nigga my African-American friend

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-10 10:11

>>256 C standard arguments for main() array of chars
main(int argc,char**argv)
argc=count of args, argv=chars[]


______________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The knowable world is incomplete if seen from any one point of view, incoherent if seen from all points of view at once, and empty if seen from nowhere in particular

Name: Anonymous 2009-08-10 10:13

>>257
whats "African-American"?

Name: Anonymous 2009-08-10 10:19

>>259
A nigger

Name: Anonymous 2009-08-10 10:28

>>260
An American nigger

Name: Anonymous 2009-08-10 10:33

>>261
That's redundant.

Name: Anonymous 2009-08-10 10:35

>>259
An U.S. national that has racial features as native Africans.

Name: Anonymous 2009-08-10 10:42

>>259-263

$
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaacaaaaaacbbbbbbbbbbbbbbbbbb
bcaaaaaaaaaacbbbbbbbcbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbca
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac
aaaaaaaaaaaaaaaaaaaaaaaaaaacbbccbbcaaaaaaaaaaa
aac

Name: Anonymous 2009-08-10 10:49

>>260-263
What do they call niggers in Britain?

Name: Anonymous 2009-08-10 11:07

>>265
darkies

Name: Anonymous 2009-08-10 11:16

>>265-266

Back to /b/, heathen.

Name: Anonymous 2009-08-10 11:20

liftM2 aaaacbcaaac aaccbcaaaaaacc bbbbbbbbbbbbbcacbbbbbbbbbbbb

Name: Anonymous 2009-08-10 11:48

>>268
4 3 6 8 8 7 13 13 0 1

Name: Anonymous 2009-08-10 16:30

Guys, ABC is old.  Super Stack! is where it's at!

Name: Anonymous 2009-08-10 18:05

>>267
nigger!  xD

Name: Anonymous 2009-08-10 19:30

>>271
*African American! xD

Name: Anonymous 2009-08-11 0:45

>>272
Nigger, see also nigga, niggah etc. al.(noun)1.describes an ignorant, uneducated, foolish individual regardless of race, color, religion, sexual orientation, etc.
2. endearing term between two or more individual to describe a friendship or bond.
1.Shut up, you nigger
2. Chris, you my nigga

Name: Anonymous 2009-08-16 1:46

Lain.

Name: Anonymous 2009-08-16 2:23

Lain.

Name: Anonymous 2009-08-16 2:43

Lain.

Name: Anonymous 2009-08-16 2:45

Lain.

Name: Anonymous 2009-08-16 3:08

Lain.

Name: Anonymous 2009-08-16 3:21

Lain.

Name: Anonymous 2009-08-16 3:35

Lain.

Name: Anonymous 2009-08-16 3:41

Lain.

Name: Anonymous 2009-08-16 3:43

Lain.

Name: Anonymous 2009-08-16 3:46

Lain.

Name: Anonymous 2009-08-16 4:04

Lain.

Name: Anonymous 2009-08-16 4:11

Lain.

Name: Anonymous 2009-08-16 4:15

Lain.

Name: Anonymous 2009-08-16 6:28

Lain.

Name: Anonymous 2010-08-15 15:29

>>1
Proof that Xarn wrote shitty code in the past.

Name: Anonymous 2010-08-15 15:44

>>288
1. It's good code.
2. There's no proof it's that guy.

Name: Anonymous 2010-08-15 15:44

>>288
Hello, >>1.

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.

Name: Anonymous 2010-08-15 15:59

>>289
BUFFA

Name: Anonymous 2010-08-15 16:10

chuis chatfatigué le haxxeur et j'ai une zone privée de haxx ;) haxx haxx !

Name: Anonymous 2010-08-15 16:12

>>291
What do you think is wrong with that code?

Name: Anonymous 2010-08-15 16:22

>>294
1. char argv*[]
2. BUFFA not initialized.

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

Name: Anonymous 2010-08-15 17:38

>>156
optimise your BBCODE

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.

Name: Anonymous 2010-08-15 17:45

>>288
Xarn did not write >>1, but I think I remember he said he did write >>53.

Name: Anonymous 2010-08-15 17:53

>>296

Also yes, that is ebx for BUFFA!.

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.

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;
}

Name: Anonymous 2010-08-15 20:14

Maybe inverted means bitwise NOT?

Name: Anonymous 2010-08-15 21:14

>>303
From the reference implementations it's now clear he meant multiplication by -1.

Name: Anonymous 2010-08-16 1:17

>>302
EXPERT NEAT PREPROCESSOR USAGE
#define IF(cond, x) if (cond) {x}

Name: Anonymous 2010-08-16 1:20

>>304
Maybe he meant a bitwise prolapse.

Name: Anonymous 2010-08-16 2:40

>>305
Bah, this is for experts:
#define IF(cond, x) if( (cond) ) {x}

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

Name: Anonymous 2010-08-16 9:45

>>308
So, it doesn't do anything?

Name: Anonymous 2010-08-16 10:06

>>309
Just like NOP, fuckshit.

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.

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.

Name: Anonymous 2010-08-16 13:01

I think >>309-312 accurately displays why /prog/-riders have no friends.

Name: Anonymous 2010-08-16 13:57

>>313
You're projecting, Xarn.

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.

Name: Anonymous 2010-08-16 14:58

Why are we discussing a toy logic gate.

Name: Anonymous 2010-08-16 15:02

In before the XARN gate.

Name: Anonymous 2010-08-16 15:27

>>317

 A B | out
-----+----
 0 0 |  1
 0 1 |  1
 1 0 |  0
 1 1 |  Python

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.

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.

Name: Anonymous 2010-08-17 3:13

This is the HMA gate. It requires the presence of both an anus and a haxor. Note that it is distinct from the AND gate.


 anus haxor | out
------------+----------
    0     0 | 0
    0     1 | 0
    1     0 | 0
    1     1 | HAX MY ANUS

Name: Anonymous 2010-08-18 19:12

>>307
this is how realEXPERTS make use of the cpp:

#define IF(condition, statement)                \
        do {                                    \
                if ( (condition) ) {            \
                        (statement);            \
                }                               \
        } while (0)

Name: Anonymous 2010-08-18 19:41

>>322
FV-style for decreased code size; uses GNU extensions.
#define F(a,...) ((a)?:(__VA_ARGS__))

Name: Anonymous 2010-08-18 19:51

>>322
EXPERT RECURSION

Name: Anonymous 2010-08-18 19:52

>>323
uses GNU extensions.
enjoy your non standard compliant code, ``faggot''.

Name: Anonymous 2010-08-18 20:15

EXPERT GOLF SOLUTION:
{57- 1^}%'+'/'.p'*0\~;

Map x-57 xor 1: a -> ')' (golfscript increment), b -> '(' (golfscript decrement), c -> '+'. Split over '+', join array with '.p' (golfscript print), push 0, swap, execute, pop.

Name: Anonymous 2010-08-18 20:18

>>325
So what's the point of programming when you don't make use of useful features to help with your problem?

Name: Anonymous 2010-08-18 20:28

>>327
So what's the point of programming when you don't make use of useful features to help with your problem?
standard compliance == portability.
protip: not everyone uses Java

Name: Anonymous 2010-08-18 20:37

>>328
So write a couple of functions when you need them. It's not that hard.

Name: Anonymous 2010-08-18 20:49

>>329
gnu extensions != a couple of functions.
back to the imageboards, ``faggot''.

Name: Anonymous 2010-08-19 2:34

>>330
If you only use a couple of them (which realistically you will), it's only a couple of functions.

Name: Anonymous 2010-08-19 3:59

>>329,331
They're not functions. They're language extensions.

Name: >>331 2010-08-19 4:43

>>332
I don't mean ``functions'' in the sense of ``procedures'' or ``subroutines'', I meant it in the sense of ``functionality''.

Name: Anonymous 2010-08-19 11:01

>>333
WHBT

Name: Anonymous 2010-08-19 14:32

Can anyone link me to the design documents for this language?

Name: Anonymous 2010-08-19 14:52

>>335

I just realized it was a bad idea to sage considering it was off the front page.

What I'm really wondering is if the language is supposed to work like >>53 writes it? Is the ``l'' command supposed to create an infinite loop? Also shouldn't i get set to -1 so the first part of args[0] doesn't get ignored?

Name: Anonymous 2010-08-19 15:27

Google is hard.

Name: Anonymous 2010-08-19 15:33

>>337

Of course I tried to Google it, however searching for ``the ABC programming language'' yields results about a quite different language.

Name: Anonymous 2010-08-19 16:32

>>338
...a language that forces the indentation of code, thread over.

Name: Anonymous 2010-08-20 3:13

>>338
Read the fucking thread. >>185

Name: ​​​​​​​​​​ 2010-09-08 21:49

Name: Anonymous 2010-12-06 9:16

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2011-01-02 2:45

This thread has been indirectly mentioned in

http://dis.4chan.org/read/prog/1293952421

Name: Anonymous 2011-01-02 19:50

bampu

Name: Anonymous 2011-01-02 21:32

How do you interpret r - Set accumulator to a random number between 0 and accumulator?

Is the accumulator now strictly between 0 and its previous value, or is 0 included in the set of possible values?

Name: Anonymous 2011-01-02 21:43

>>347
Simulate a dice throw:
aaaaarac
In the example above (from esolang) the interval would be [0, 5).

In english: Set the accumulator to a random value between 0 inclusive and the accumulator exclusive.

Name: Anonymous 2011-01-02 22:16

>>348

OK, thank you, may I also ask you how you interpret d - Invert accumulator?

Name: Anonymous 2011-01-02 22:40

All right I have a pseudo-working implementation, my former implementation was completely crippled, this implementation is only severely crippled by lacking error handling and the handling of the `;' character, it also assumes that the accumulator is unsigned, which it judging by the phone number example isn't.

;; abc.asm
;; @Author Gerald Jay Sussman
;; Assemble with $ nasm -f elf abc.asm
;; Link with     $ ld -s -o abc abc.o

%define PFBLEN    0xff

%macro    write    2
    pusha
    mov    ecx, %1
    mov    edx, %2
    mov    eax, 4
    mov    ebx, 1
    int    0x80
    popa
%endmacro

section    .bss
printf_buffer:    resw    PFBLEN
char_buffer:    resw    2
argc:        resw    2
randfd:        resw    2
randint:    resw    2

section    .data
error:    dw    "An error occured.", 0xa, 0
randf:    dw    "/dev/urandom", 0
newl:    dw    0xa
ascii:    db    0

section    .text
    global    _start

_start:
    pop    eax
    cmp    eax, 1
    jle    .error

    mov    [argc], eax

    mov    eax, 5
    mov    ebx, randf
    xor    ecx, ecx
    int    0x80

    mov    [randfd], eax

    pop    eax
    pop    ecx
    xor    edx, edx
    xor    ebx, ebx
.loop:
    mov    eax, [ecx + edx]

    cmp    al, 0x0
    je    .next

    cmp    al, 'a'
    je    .a
    cmp    al, 'b'
    je    .b
    cmp    al, 'c'
    je    .c
    cmp    al, 'd'
    je    .d
    cmp    al, 'r'
    je    .r
    cmp    al, 'n'
    je    .n
    cmp    al, '$'
    je    .cash
    cmp    al, 'l'
    je    .l
    cmp    al, 0x3b
    je    .dbg
.bottl:
    inc    edx
    jmp    .loop
.fin:
    mov    eax, 1
    mov    ebx, 0
    int    0x80
.next:
    write    newl, 1
    dec    dword [argc]
    cmp    dword [argc], 1
    jle    .fin
    pop    ecx
    xor    edx, edx
    jmp    .loop
.error:
    write    error, randf - error

    mov    eax, 1
    mov    ebx, 1
    int    0x80
.a:
    inc    ebx
    jmp    .bottl
.b:
    dec    ebx
    jmp    .bottl
.c:
    cmp    byte [ascii], 0
    je    .asint
.aschar:
    mov    dword [char_buffer], ebx
    write    char_buffer, 1
    jmp    .bottl
.asint:
    mov    eax, ebx
    call    print_eax_int
    jmp    .bottl
.d:
    neg    ebx
    jmp    .bottl
.r:
    pusha
    push    ebx
    mov    eax, 3
    mov    ebx, [randfd]
    mov    ecx, randint
    mov    edx, 8
    int    0x80

    pop    ebx
    inc    ebx
    xor    edx, edx
    mov    eax, [randint]
    idiv    ebx
    mov    [randint], edx
    popa
    mov    ebx, [randint]
    jmp    .bottl
.n:
    xor    ebx, ebx
    jmp    .bottl
.cash:
    xor    byte [ascii], 1
    jmp    .bottl
.l:
    xor    edx, edx
    jmp    .loop
.dbg:
    jmp    .error

print_eax_int:
    pusha
    lea    ecx, [printf_buffer + PFBLEN]
.loop:
    sub    ecx, 4

    xor    edx, edx
    mov    ebx, 10
    idiv    ebx
    add    edx, 0x30
   
    mov    [ecx], edx

    cmp    eax, 0
    jle    .ret

    jmp    .loop
.ret:
    mov    eax, 4
    mov    ebx, 1
    lea    edx, [printf_buffer + PFBLEN]
    sub    edx, ecx
    int    0x80
    popa
    ret

Name: Anonymous 2011-01-03 11:02

>>350
Finally, another /prog/lodyte who enjoys the art of intel asm

Heil!

Name: Anonymous 2011-01-03 12:30

>>351

You may note that my knowledge of the instruction set is extremely limited, but I'm learning.

Name: Anonymous 2011-01-04 19:36

How often on average will the abc line ``arcl'' output a natural integer n?

Name: Anonymous 2011-01-04 19:39

>>353

If you count 0 a "natural integer", all the time.

I presume you meant to say a given natural number?

Name: Anonymous 2011-01-05 11:41

I have two improved versions of the string and integer printers for the abc program.

section    .bss
intbuf:    resb    32

section    .text
    global    print_signed
    global    print_str

print_signed:
    pushad
    lea    ecx, [intbuf + 32]

    bsr    ebx, eax
    cmp    ebx, 31
    pushf
    jne    .loop
    neg    eax
.loop:
    dec    ecx

    xor    edx, edx
    mov    bl, 10
    div    ebx

    add    dl, 0x30
    mov    [ecx], dl

    cmp    eax, 0
    je    .end

    jmp    .loop
.end:
    popf
    jne    .ret
    dec    ecx
    mov    byte [ecx], '-'
.ret:
    mov    eax, 4
    mov    ebx, 1
    lea    edx, [intbuf + 32]
    sub    edx, ecx
    int    0x80
    popad
    ret

print_str:
    pushad
    push    eax
    mov    edi, eax

    xor    ecx, ecx
    xor    al, al
    not    ecx
    cld
    repne    scasb
    not    ecx
    lea    edx, [ecx - 1]
    pop    ecx

    mov    eax, 4
    mov    ebx, 1
    int    0x80
    popad
    ret


Definitely maintainable, don't you think?

Name: Anonymous 2011-01-05 12:43

/prog/ CHALLENGE:
Make a compiler for The ABC Programming Language

Only ABC->ASM are allowed!
ABC->C compilers are banned as one has already been implemented by >>142.


Requirements:
• Must fully adhere to the “The ABC Programming Language  Specification” described in The ABC Programming Language page on Esolangs.org[1]
• One can implement non-standard extensions to the language as long they don't break compatibility with the standard[1].

Bonus points if:
• It's an optimising compiler.
• Has flags to switch optimisations on/off.
• It's written in fully POSIX-compliant C code. (if using another language, it must be executable on every POSIX-compliant system)
• It writes directly an ELF executable or equivalent.
• The generated code is efficient.
• The compiler is written in well-written, efficient and idiomatic code.

--
References:
[1] http://esolangs.org/wiki/ABC

Name: Anonymous 2011-01-05 13:16

>>356

May I make it write assembly and then pipe that to some assembler, or must it directly write opcodes to file?

Name: Anonymous 2011-01-05 13:24

>>357
Making yourself the opcodes to file gives you bonus points.

Name: Anonymous 2011-01-05 19:45

>>358

May I link with my favorite copy of a C library?

Name: Anonymous 2012-08-04 14:37

WARNING: NECROBUMP; DO NOT REPLY

Name: Anonymous 2012-08-04 15:07

what happens if I _do_ reply?

Name: Anonymous 2012-08-04 16:56

>>361
congratulations, you just set off a chain of events that causes the world to end in December.

Name: Anonymous 2012-08-04 18:01

>>361
Go back to reddit!

Name: Anonymous 2012-12-14 14:45

ABC

Name: Anonymous 2012-12-14 14:55

>>364
IT'S EASY AS 123!

Name: Anonymous 2012-12-14 18:10

I am currently working on building a fully-compliant interpreter from some of the toy examples presented in this thread. I am trying to decide on a price point. How much does the ABC Programming Language's abysmal lack of enterprise solutions cost you in today's economic climes?

Don't change these.
Name: Email:
Entire Thread Thread List