Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A List
#1
(add your own or disagree about them, or add parts to parts.)

THE QB CONSTITUTION

If we don't use QB, what are we?

Sure, you may learn other languages or whatnot, but QB is still good, for these 7 or more reasons:

1) One misplaced parentheses won't kill the whole program.

2) A non-confusing print routine / graphics routine is there for you, so you can instantly start coding.

3) It's faster than Java, usually. And you don't have to muck around Sun's website to find the compiler and figure out how the hell you're going to use it.

4) It can use external ASM routines, from which you can actually make QB speed competitive (in most respects with C++ speed)

5) It's easy to read and understand. Even spaghetti code is easy to fix into better code if you know what you're doing. I fixed a whole line-number spaghetti-code gig into a real game!

6) It works for those cheap computers in the Phillipines. Smile

7) IT WORKS IN UNIX.

Well ok that was 1/2 sarcasm and 1/2 truth. You can emulate DOS.. with *Java* VNC stuff and with dosemu. Supposedly.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#2
If we don't use QB, what are we? Lazy lamers, according to some. :roll:


1. No, but usually the proggie will malfunction.

2. True. Not the best, though, but hey! Better than nothing...

3. :o *silence*

4. C/C++ can use ASM too. [Image: biglaugh.gif]

5. True again. That's one of the leitmotifs of BASIC: easy to understand.

6. REEEEEEEEEEEEEEEEEEEEEEEEEL! [Image: screams.gif]

7. :o *no comments again*
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Reply
#3
6) It works for those cheap computers in the Phillipines.



CHEAP?!!!!
LOL

Hey don't forget that you could make a 3d rotator and a floormapper in 9 lines of QB code w/o libs. Now try that with C, C++, Delphi or any of your flavors!!!

:*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#4
Okay, its not quite 9 lines and I didnt write it (I reformated the code a little, it was a bit longer and less readable :rollSmile, but the following C program is a ascii based 3d maze game. It uses the \, /, | and _ characters to render the scene. Both the game code and level data is included in the C file.

Code:
#include <stdio.h>
#define X(s) (!(s&3)-((s&3)==2))
#define W while
char Z[82][82],A,B,f,g=26;z(q){return atoi(q);}m(d,l){return
Z[B + X (f+3) * d+l *X(f+2)][A+X(f)*d+l*X(f+3)];}int h=0;
D(p,s)char*s; {W(h>>3<p>> 3 ) {putchar('\t'); h = (h+8)&~7 ;}W(h < p ){putchar(' ');++h;}
(void)printf("%s",s);h+=strlen(s);}main(x,a)char **a; {
# define P(x) (x?(5-(x))*(6-(x ))/2:11)
int b; { char b[256],i,  j=0;  FILE*F;F=fopen(x-1?a[1]:"buzzard.c","r");W(
fgets( b ,256 ,F)){for(i=0;b[ i];++ i)
Z[j][i]=(b[i]==' '?1:2*(b[i]==(x>2?*a[2]:'\\')));++j;}fclose
(F);}A=4;B=3;f=1;x >3? A=z(a[3]),B=z(a[4]):0;b='\n';do{if(b=='\n'
){int y,s,d,p,q,i;for(y=-11; y<= 11;++ y){ for(s = 1 ,d=0;s+3;s-=2){for(;d!=2+3*s;d+=s){
if(m(d,0)!=1){p=P(d);if(abs(y)<p&& !m(d, 0 )||abs(y)>p)break;for
(i=-p;i<p;++i)D(g+i*2,"--");D(0,"\-");break;}if(d==5)continue;
p=P(d+1);q=P(d);if(abs(y)>q)continue;if(abs(y)<p)D(g-s*(2*p+1),"|");else if(m(d,s)){if
(abs(y)<=p)for(i=(s==1?-q:p);i!=(s==1?-p:q);
(abs(y)),++i)D(g+2*i+(s==-1),"--");}else if(abs(y)==p)D(g-s*(2*p+1),"|");else D(g-(abs(y)    *s*2),(s==1)^(y>0)?"\\":"/");}d-=s;}puts("");h=0;}}f+=(b=='r')-(b=='l');f&=3;if(b=='f'){
if(!m(1,0))continue;A+=X(f);B+=X(f-1);}}W((b=getchar())!=-1&&m(0,0)==1);return 0;}

Confusing eh? Wanna see more like it, check out:
http://www.ioccc.org/
esus saves.... Passes to Moses, shoots, he scores!
Reply
#5
but it isn't readable. I'll try it.

(edit)

Error. Kernel32.dll error.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#6
It works in UNIX!!???

Big Grin :bounce: Big Grin
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#7
Only with emulation. Unfortunately. Perhaps someday someone will make a 100% clone (minus the bugs).
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#8
The code may have got hashed a little when I pasted it, try getting the original (buzzard.c) from ioccc. It may not compile correctly with a large number of compilers, because obfuscated C code tends to stress some of the lesser compilers out there (*cough* MSVC *cough*). IIRC the entries are tested with the System V compiler, BSD compiler and gcc (among others), you could try one of those. And what do you mean its not readable? :o
esus saves.... Passes to Moses, shoots, he scores!
Reply
#9
Well of course it's readable. I was just kidding.

:rotfl:
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#10
Quote:Okay, its not quite 9 lines and I didnt write it (I reformated the code a little, it was a bit longer and less readable :rollSmile, but the following C program is a ascii based 3d maze game. It uses the \, /, | and _ characters to render the scene. Both the game code and level data is included in the C file.

Code:
#include <stdio.h>
#define X(s) (!(s&3)-((s&3)==2))
#define W while
char Z[82][82],A,B,f,g=26;z(q){return atoi(q);}m(d,l){return
Z[B + X (f+3) * d+l *X(f+2)][A+X(f)*d+l*X(f+3)];}int h=0;
D(p,s)char*s; {W(h>>3<p>> 3 ) {putchar('\t'); h = (h+8)&~7 ;}W(h < p ){putchar(' ');++h;}
(void)printf("%s",s);h+=strlen(s);}main(x,a)char **a; {
# define P(x) (x?(5-(x))*(6-(x ))/2:11)
int b; { char b[256],i,  j=0;  FILE*F;F=fopen(x-1?a[1]:"buzzard.c","r");W(
fgets( b ,256 ,F)){for(i=0;b[ i];++ i)
Z[j][i]=(b[i]==' '?1:2*(b[i]==(x>2?*a[2]:'\\')));++j;}fclose
(F);}A=4;B=3;f=1;x >3? A=z(a[3]),B=z(a[4]):0;b='\n';do{if(b=='\n'
){int y,s,d,p,q,i;for(y=-11; y<= 11;++ y){ for(s = 1 ,d=0;s+3;s-=2){for(;d!=2+3*s;d+=s){
if(m(d,0)!=1){p=P(d);if(abs(y)<p&& !m(d, 0 )||abs(y)>p)break;for
(i=-p;i<p;++i)D(g+i*2,"--");D(0,"\-");break;}if(d==5)continue;
p=P(d+1);q=P(d);if(abs(y)>q)continue;if(abs(y)<p)D(g-s*(2*p+1),"|");else if(m(d,s)){if
(abs(y)<=p)for(i=(s==1?-q:p);i!=(s==1?-p:q);
(abs(y)),++i)D(g+2*i+(s==-1),"--");}else if(abs(y)==p)D(g-s*(2*p+1),"|");else D(g-(abs(y)    *s*2),(s==1)^(y>0)?"\\":"/");}d-=s;}puts("");h=0;}}f+=(b=='r')-(b=='l');f&=3;if(b=='f'){
if(!m(1,0))continue;A+=X(f);B+=X(f-1);}}W((b=getchar())!=-1&&m(0,0)==1);return 0;}

Confusing eh? Wanna see more like it, check out:
http://www.ioccc.org/


*trys to read it*
*gives up after 5 min being very frustrated over the silly pice of code*
*edited*
hey where did the main go????
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)