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.