|
Speed
Dec 24, 2004 21:12:12 GMT -5
Post by Vladik on Dec 24, 2004 21:12:12 GMT -5
BASIC is a basic programming language-but it's so slow! Can anyone make it faster-optimize the loops, improve the code? That should give all of you something to dwell on.
|
|
Jc
Where's the color screen?
Two lettered name!
Posts: 9
|
Speed
Dec 25, 2004 20:54:19 GMT -5
Post by Jc on Dec 25, 2004 20:54:19 GMT -5
You can always use ASM utilites for sprites, other cool stuff too. That seems to be quite speedy.
|
|
|
Speed
Dec 26, 2004 13:38:22 GMT -5
Post by Vladik on Dec 26, 2004 13:38:22 GMT -5
True, but this will not be true BASIC. Is there even a way to do this for the TI-86 series and the 68k series?
|
|
|
Speed
Dec 30, 2004 13:06:33 GMT -5
Post by bfr on Dec 30, 2004 13:06:33 GMT -5
I hope so. Maybe there is something on the ticalc site.
|
|
|
Speed
Dec 30, 2004 13:12:40 GMT -5
Post by Vladik on Dec 30, 2004 13:12:40 GMT -5
Maybe you could optimize the loops... I mean... which loop is faster? The While loop or the For loop?
|
|
|
Speed
Dec 30, 2004 14:12:22 GMT -5
Post by bfr on Dec 30, 2004 14:12:22 GMT -5
I NEVER use the While loop. The for( loop rocks!!!
|
|
|
Speed
Dec 30, 2004 14:19:17 GMT -5
Post by Vladik on Dec 30, 2004 14:19:17 GMT -5
The while loop allows you to control the looping from inside the loop, whitout resorting to For a,1,5 2->a CODE GOES HERE If CONDITION=True(==1 in TI-86 BASIC) 5->a EndFor (or End in TI-86 BASIC) This can be done using this: While CONDITION CODE GOES HERE EndWhile (End)
|
|
|
Speed
Jan 7, 2005 17:28:18 GMT -5
Post by bcherry on Jan 7, 2005 17:28:18 GMT -5
In reply to the query about being able to incorporate asm utilities into 86 or 68k, yes you can. On 68k you could potentially even use the Exec command, but you need to know the binary equivalent of what you want to do. I think there are some utilities that turn an asm program into an Exec string, but that's not really a great way to do it. I'm not sure of exactly what tools to use to incorporate sprite functions and stuff, but I know that it can be done. On a side note, the most impressive BASIC program I have ever seen is William Bourgeois' "Le Manoir de Mortville", which can be found on this page: oragestudio.free.fr/ti89.phpUnfortunately, it is in French... I was supposed to translate it for him actually, but I never finished. Never really started much either...
|
|
|
Speed
Jan 7, 2005 17:33:22 GMT -5
Post by Vladik on Jan 7, 2005 17:33:22 GMT -5
Yes, the exec() function is quite handy. But there are also utilities like flib, which are annoying; most games can be greatly improved in C/ASM. I would really like to try that game that you mentioned; but unfortunately, I don't speak French.
|
|
|
Speed
Jan 7, 2005 17:42:25 GMT -5
Post by bcherry on Jan 7, 2005 17:42:25 GMT -5
>>I NEVER use the While loop. The for( loop rocks!!!
Probably you are like I was, and don't even really understand the usefulness of While. I never used it when I started out doing TI-BASIC. But when I started to learn C, I realized just what it did and how useful it is in game design, far better than For. Now even when doing BASIC I use While instead of For. One of my big speed problems I had before using While was in getKey. I did something like this:
Lbl 1 getKey->K If k=0 Goto 1 If k=34 Goto 34 If k=24 Goto 24 .... Lbl 34 ...do stuff for down... ...using subtraction on the y-coordinate... Lbl 24 ...
That was how I wrote my first worm game... It was too slow. Now that I understand While, I can do this:
0->k While k != 45 //45 would be clear, which would be quit getkey->k If k=34:Then 0->A:-1->B //A is the delta x variable, B is dy Else If k=25: Then 0->A:1->B Else If k=24: Then -1->A:0->B Else If k=26: Then 1->A:0->B X+A->X Y+B->Y ...print a pixel at X,Y... End
That is an almost complete movement routine for a simple never-ending worm. The game continues until you press Clear. It doesnt check for out of bounds or going backwards yet though, but it would be quite easy to do.
|
|
|
Speed
Jan 7, 2005 17:44:48 GMT -5
Post by bcherry on Jan 7, 2005 17:44:48 GMT -5
>>I would really like to try that game that you mentioned; but unfortunately, I don't speak French.
Lol, I tried the game out too, but as I didn't know French I couldnt figure out the complicated controls. I think I did translate the readme file though. (If you're wondering how I could translate the program if I don't even know French, I was using Google Translate and fixing the broken English, and getting help from a friend who knows some French.)
|
|
|
Speed
Jan 7, 2005 17:45:14 GMT -5
Post by Vladik on Jan 7, 2005 17:45:14 GMT -5
Yes. I also *realized* the while loop when I started C... Before, I was using Goto...Lbls and Fors.
Wait... you programmed a worm game in BASIC? *GASP*
|
|
|
Speed
Jan 9, 2005 20:55:24 GMT -5
Post by bfr on Jan 9, 2005 20:55:24 GMT -5
Hold on. Does C offer any commands that are fast versions of the commands in BASIC? My sister is nice. She amde me say that.
|
|
|
Speed
Jan 9, 2005 20:57:17 GMT -5
Post by Vladik on Jan 9, 2005 20:57:17 GMT -5
Well, all of C is a fast version of BASIC!
(Of course, C is independent of BASIC, and it has MUCH more commands)
|
|
|
Speed
Jan 10, 2005 17:29:00 GMT -5
Post by bfr on Jan 10, 2005 17:29:00 GMT -5
Does C work similar to BASIC? Is it just like a fast BASIC with more commands?
|
|
|
Speed
Jan 10, 2005 17:29:51 GMT -5
Post by bfr on Jan 10, 2005 17:29:51 GMT -5
Or are the syntaxes different? (sorry for double-posting-I just thought of this).
|
|
|
Speed
Jan 10, 2005 17:45:40 GMT -5
Post by Vladik on Jan 10, 2005 17:45:40 GMT -5
C has nothing to do with BASIC; it is a completely different programming language.
|
|
|
Speed
Jan 22, 2005 8:15:49 GMT -5
Post by Simon on Jan 22, 2005 8:15:49 GMT -5
I there french people in this furum ?
|
|
|
Speed
Jan 22, 2005 13:45:54 GMT -5
Post by bfr on Jan 22, 2005 13:45:54 GMT -5
You checked out bcherry's website? I did too. It's in French.
|
|
|
Speed
Jan 22, 2005 15:16:51 GMT -5
Post by Vladik on Jan 22, 2005 15:16:51 GMT -5
I don't believe that that website is completely bcherry's.
I think that he is just part of the group...
|
|