|
Post by bfr on Mar 15, 2005 18:17:25 GMT -5
|
|
|
Post by bcherry on Mar 15, 2005 20:45:31 GMT -5
couple tips for you in writing BASIC code:
use "<=" or ">=" or "!=" for less than or equal, greater than, and not equal, respectively.
Find out the name of the greek symbol. I suspect you meant "theta", which is like an 0 with a cross through it.
And it's "ClLcd", as in "Clear LCD", not "C1LCD"
Anyways, here's a program in Ti-83 Basic I threw together in class the other day. See if you can figure out what it does:
:10->N:20->M:15->L:2->P:270->theta:1->T:N->H :{470,470,470,470,470,470,470,470,470,470}->LX :{90,80,70,60,50,40,30,20,10,0}->LY :0->Xmin:940->Xmax:-620->Ymin:0->Ymax :Degree:Func:Full:RectGC:CoordOff:GridOff:AxesOff:LabelOff:ExprOff:PlotsOff :ClrDraw :0->K :While K!=45 :getKey->K :theta+(K=24)*L-(K=26)*L->theta :If theta>=360:0->theta :Pt-Off(LX(T),LY(T),P :LX(H)+cos(theta)*M->LX(T) :LY(H)+sin(theta)*M->LY(T) :T->H:T+1->T:If T>N:1->T :Pt-On(LX(H),LY(H),P :End :ClrDraw :ClrHome
Those "LY" and "LX" are lists, using the little "L" symbol. And all those variables at the beginning are used as control parameters for speed, agility, shape, length, etc. As if that wasn't a hint...
|
|
|
Post by bfr on Mar 16, 2005 19:18:08 GMT -5
I think that your program involves something...probably something c 8-) 8-)l, but I'm not complettely sure what :-/ ;). Also, the greek symbol is the same symbol that is used to represent resistance in ohms.
Here is some more code: :While G==0 :ClLCD :getKy->G :Outpt(5,5,"MONSTER" :Outpt(6,C,"-" :C+1->C :If C==11 :5->C :End :ClLCD That is PART of the intro to a BASIC game I'm working on.
|
|
|
Post by Pure on Mar 16, 2005 19:45:02 GMT -5
part of my new VTOS 4:
If length(Str1)=0:Then:":"->Str1 Lbl B 1->X Repeat G=6 String>Equ(StrX,rX X+1->X End
That part is basically converting the strings that you store information to, into graph variables. In total, it uses r1-r6 and Y1-Y0
Look for more code coming soon!
|
|
|
Post by bcherry on Mar 16, 2005 20:03:07 GMT -5
that greek symbol would be Omega.
|
|
|
Post by bcherry on Mar 16, 2005 20:16:29 GMT -5
Here is the first ever publication of Metroid code:
int boundingBoxCollide(int x, int y, int w, int h, int x2, int y2, int w2, int h2) { return (x<x2&&x+w>x2&&y>y2&&y-h<y2) || (x<x2+w2&&x+w>x2+w2&&y>y2&&y-h<y2) || (x<x2&&x+w>x2&&y>y2-h2&&y-h<y2-h2) || (x<x2+w2&&x+w>x2+w2&&y>y2-h2&&y-h<y2-h2) || (x<x2+w2/2&&x+w>x2+w2/2&&y>y2&&y-h<y2) || (x<x2+w2/2&&x+w>x2+w2/2&&y>y2-h2&&y-h<y2-h2) || (x<x2&&x+w>x2&&y>y2-h2/3&&y-h<y2-h2/3) || (x<x2+w2&&x+w>x2+w2&&y>y2-h2/3&&y-h<y2-h2/3) || (x<x2&&x+w>x2&&y>y2-2*h2/3&&y-h<y2-2*h2/3) || (x<x2+w2&&x+w>x2+w2&&y>y2-2*h2/3&&y-h<y2-2*h2/3); }
|
|
|
Post by bfr on Mar 17, 2005 17:27:13 GMT -5
int boundingBoxCollide(int x, int y, int w, int h, int x2, int y2, int w2, int h2) { return (x<x2&&x+w>x2&&y>y2&&y-h<y2) || (x<x2+w2&&x+w>x2+w2&&y>y2&&y-h<y2) || (x<x2&&x+w>x2&&y>y2-h2&&y-h<y2-h2) || (x<x2+w2&&x+w>x2+w2&&y>y2-h2&&y-h<y2-h2) || (x<x2+w2/2&&x+w>x2+w2/2&&y>y2&&y-h<y2) || (x<x2+w2/2&&x+w>x2+w2/2&&y>y2-h2&&y-h<y2-h2) || (x<x2&&x+w>x2&&y>y2-h2/3&&y-h<y2-h2/3) || (x<x2+w2&&x+w>x2+w2&&y>y2-h2/3&&y-h<y2-h2/3) || (x<x2&&x+w>x2&&y>y2-2*h2/3&&y-h<y2-2*h2/3) || (x<x2+w2&&x+w>x2+w2&&y>y2-2*h2/3&&y-h<y2-2*h2/3); }
Wow.
|
|
|
Post by Vladik on Mar 17, 2005 20:14:16 GMT -5
Cool codes!
And here is a BASIC translation of bcherry's Metroid code snippet simbols for those of us who don't understand it. Bfr.
||=OR &&=AND
|
|
|
Post by bfr on Mar 17, 2005 20:52:00 GMT -5
Hey, I know some of that stuff . Also, for those of you that don't know (although most of you do...I hope) there is xand and xor for computers. I think calcs have xor but not xand. There is also "not".
|
|
|
Post by bfr on Apr 6, 2005 23:45:16 GMT -5
Are you going to post this on your website, bcherry?
|
|
|
Post by bcherry on Apr 7, 2005 0:15:35 GMT -5
that bit of code? No. It will all end up in the tutorial anyways.
|
|
|
Post by bfr on Apr 7, 2005 21:03:07 GMT -5
Oh. ;D
|
|
|
Post by Pure on Apr 8, 2005 18:29:20 GMT -5
that would be just as good...
|
|