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.
>>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:
Anonymous2008-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:
Anonymous2008-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:
Anonymous2008-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.
>>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:
Anonymous2008-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:
Anonymous2008-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.
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 SecondThe ABC Programming LanguageAlgorithmic 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:
Anonymous2008-08-01 21:58
I love you
Name:
Anonymous2008-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.
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:
Anonymous2008-08-03 18:54
This thread is about the ABC programming language, for newcomers to the discussion :)
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:
Anonymous2008-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
>>126
There's more programming discussion on /prog/ right now than there has been in many months.
Name:
Anonymous2008-08-05 11:38
Even if it IS an esoteric one.
Name:
Anonymous2008-08-05 13:42
Name:
Anonymous2008-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:
Anonymous2008-08-05 18:59
looks pretty much like a knockoff version of Brainfuck to me...
Name:
Anonymous2008-08-06 1:05
I'm surprised no one even touched the wiki page.
Name:
Anonymous2008-08-06 6:49
You didn't look very closely (or too soon, whatever)
Name:
Anonymous2008-08-06 6:50
Apparently Orange himself visits /prog/ and linked to this thread
Name:
Anonymous2008-08-06 8:35
>>136
Then there's only two possibilities: either you're User:Orange, or the Sussman invented the ABC programming language.
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;
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:
Anonymous2008-08-26 6:37
>>151
Let's not emulate the worst language in mainstream use today, for a change.
>>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.
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
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';
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:
Anonymous2008-10-27 16:24
>>183
Bug report: it leaks memory, you forgot to free() progstr
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.
>>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.
>>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.
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:
Anonymous2008-10-29 10:43
>>196 sensible copyright laws where any work without a copyright notice is in the public domain
Wait, what?
Name:
Anonymous2008-10-29 16:41
This thread is threadstopped. You can't reply anymore.
Name:
Anonymous2008-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:
Anonymous2008-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.
>>197
How hard is it to either plaster a copyright notice over the work or register the work at the national copyright registry?
Name:
Anonymous2008-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:
Anonymous2008-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:
Anonymous2008-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:
Anonymous2008-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:
Anonymous2008-10-29 21:50
᷾/proͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦͦg/ does not work.
Name:
Anonymous2008-10-29 23:17
puts
Name:
Anonymous2008-11-04 18:22
tHi.s tHR.ea..d cAN"t d.ie t*he fu(tUrE dEPE$$nd$s on |t,
Name:
Anonymous2008-11-05 11:56
Stop bumping my thread, thanks. The code is embarrassing.
Name:
Anonymous2008-11-05 15:02
I propose adding a new instruction to ABC to make it turing complete.
Name:
Anonymous2008-11-05 15:23
>>210
Then learn how to code, and don't post your stupid crap on /prog/ until then.
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:
Anonymous2009-08-09 22:11
This thread has been threadstopped, you can't reply anymore.
Name:
Anonymous2009-08-09 22:41
>>251
GOD FUCKING DAMN IT I KNEW SOME FAGGOT WOULD FUCKING BUMP THIS
Name:
Anonymous2009-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!!!!!
>>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.
>>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
>>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
>>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
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.
>>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
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.
>>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:
Anonymous2010-08-18 20:37
>>328
So write a couple of functions when you need them. It's not that hard.
Name:
Anonymous2010-08-18 20:49
>>329
gnu extensions != a couple of functions. back to the imageboards, ``faggot''.
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?