sometimes99er Posted September 1, 2016 Share Posted September 1, 2016 (edited) Exsqueeze me. Bugs Bunny fan art parody. Ha ha ha ... Edited April 5, 2018 by sometimes99er 6 Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted September 1, 2016 Share Posted September 1, 2016 (edited) That's pretty cool, for a noob, can you explain it line by line? I get most of it. Why 9^9? Sub and subend? Why call char, display at and sprite? Is that the only way to do 3 colors? Edited September 1, 2016 by Sinphaltimus 1 Quote Link to comment Share on other sites More sharing options...
RickyDean Posted September 1, 2016 Share Posted September 1, 2016 Exsqueeze me ! 19 Carrots of Gold, 2016.09.01 sometimes99er 100 call screen(11)::call clear::call magnify(3)::call color(9,10,1,10,3,1) 110 call char(97,"000000000000000E0F1F1B3D367860800080808",104,"000000507870F8C") 120 call char(100,"0000000007080810122124434CB0C00038544246829C60202020C") 130 for i=1 to 19::call carrot(i,int(rnd*22),int(rnd*27))::next i::for i=0 to 9^9::next i 140 sub carrot(i,y,x)::display at(y+1,x+1):"ah"; ::display at(y+2,x+1):"bc"; ::call sprite(#i,100,2,y*8+3,x*8+16)::subend run Cute, I copied and pasted it into JS99er and let it run. 1 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 (edited) That's pretty cool, for a noob, can you explain it line by line? Thanks, and no, it's really basic. I get most of it. Phew. Why 9^9? Instead of going to a new line with a GOTO looping forever. Squeezing the number of lines. 9^9 is just a really big number. Sub and subend? You have to look in the manual. Could have used GOSUB, or embedded the code, but SUB is so nice. Why call char, display at and sprite? Is that the only way to do 3 colors? The short answer. Yes. You can toggle patterns 60 times a second to get 3 colors (flickers but some combinations are better than others). Edited September 1, 2016 by sometimes99er 2 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 Cute, I copied and pasted it into JS99er and let it run. Thanks. Didn't know you could paste in js99er. Cool. Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted September 1, 2016 Share Posted September 1, 2016 Neat, not bad for such tight code. Could you add a bunny? 1 Quote Link to comment Share on other sites More sharing options...
RickyDean Posted September 1, 2016 Share Posted September 1, 2016 (edited) Thanks. Didn't know you could paste in js99er. Cool. Yep, just highlight the text here and copy, either from the menu, or ctrl C and then go into Exbasic in JS99er.net and cntrl V and wha-La. whala a bastardized english version of the French word "voila" meaning "there it is" Often used by morons (me) in an attempt to sound more intelligent than they actually are. Incidentally, voila sounds phonetically like whala hence the improper spelling. Edited September 1, 2016 by RickyDean 2 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 Neat, not bad for such tight code. Could you add a bunny? Thanks. And yes, I could add a bunny, but it would double the size of the program. And next thing would be to animate the bunny and make it a game. Let's just say it's on my list. 2 Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted September 1, 2016 Share Posted September 1, 2016 Thanks. And yes, I could add a bunny, but it would double the size of the program. And next thing would be to animate the bunny and make it a game. Let's just say it's on my list. Yeeeah, I just want to animate a little 8x8 character running across the screen...... lol. 2 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 (edited) Yeeeah, I just want to animate a little 8x8 character running across the screen...... lol. Which you've done so nicely. And it motivated me to look more into platformers. Edited September 1, 2016 by sometimes99er 3 Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted September 1, 2016 Share Posted September 1, 2016 Which you've done so nicely. And it motivated me to look more into platformers. I remember boots like those! Theme song.... https://www.youtube.com/watch?v=8CvURidpkCY 2 Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted September 1, 2016 Share Posted September 1, 2016 Regarding SUB and SUBEND... Subprograms are a unique feature of TI Extended BASIC. Basically, you can write your own subprograms just like CALL HCHAR, CLEAR, SCREEN are. You can pass values into the subprogram, both to use and to pass back values. My favorite use of subprograms, which I do in almost every program: 1000 SUB WAIT(W):: FOR I=1 TO W :: NEXT I :: SUBEND A delay subprogram, cuts down on the amount of code space wasted on FOR/NEXT loops 1000 SUB SND(S):: ON S GOTO 1010,1020,... 1010 CALL SOUND(100,110,2):: GOTO 1999 ... 1999 SUBEND A sound subprogram, all the game's sounds are contained in a single large block and can be called by using an ID number 2 Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted September 1, 2016 Share Posted September 1, 2016 Regarding SUB and SUBEND... Subprograms are a unique feature of TI Extended BASIC. Basically, you can write your own subprograms just like CALL HCHAR, CLEAR, SCREEN are. You can pass values into the subprogram, both to use and to pass back values. My favorite use of subprograms, which I do in almost every program: 1000 SUB WAIT(W):: FOR I=1 TO W :: NEXT I :: SUBEND A delay subprogram, cuts down on the amount of code space wasted on FOR/NEXT loops 1000 SUB SND(S):: ON S GOTO 1010,1020,... 1010 CALL SOUND(100,110,2):: GOTO 1999 ... 1999 SUBEND A sound subprogram, all the game's sounds are contained in a single large block and can be called by using an ID number Whoa. I only ever used gosub and return in ti xb. So sub and subend is like a script you can pass arguments to but it's self contained with in the program? (I know it doesn't have to be, they can be called from a file on disk) Ok, this is something new I need to learn. Awesome stuff. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted September 1, 2016 Share Posted September 1, 2016 (edited) Which you've done so nicely. And it motivated me to look more into platformers. Wow, thanks man. That means a lot coming from you. As for me, I can make them, but I can't wear them. 6' 300 lbs is not graceful enough for wearing them I think. Edited September 1, 2016 by Sinphaltimus 1 Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted September 1, 2016 Share Posted September 1, 2016 Whoa. I only ever used gosub and return in ti xb. So sub and subend is like a script you can pass arguments to but it's self contained with in the program? (I know it doesn't have to be, they can be called from a file on disk) Ok, this is something new I need to learn. Awesome stuff. Thanks! Yeah, subprograms are contained in the program. They have to be at the end of the program listing as well, but they can also be outside the pre-scan. Oh, what's pre-scan? Pre-scan is detailed in the little addendum XB manual. Basically, you can cut down on the time for the program to start running by reducing the amount of your program scanned ahead of time for memory allocation. The pattern you typically see of programs using it is the first block of statements are all variable/array declarations and all sub programs (built-in ones) used. That lets the pre-scan know everything it has to allocate memory for. Then it is turned off for the bulk of the program until the end, where any DATA and IMAGE statements are, as well as custom subprograms. 1 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted September 1, 2016 Share Posted September 1, 2016 Really cool, sometimes99er!!! Hoping for a new Rabbit Trail... One that has a bit of replay value. A challenge for you, Sinphaltimus... Write your own CALL CLEAR subprogram, and replace it in the following code chunk: 100 CALL CLEAR 110 PRINT "I CAN WRITE A NEW SUBPROGRAM!!" 120 END Replace CALL CLEAR with a SUB of your own design and call it CLR. 1 Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted September 1, 2016 Share Posted September 1, 2016 Really cool, sometimes99er!!! Hoping for a new Rabbit Trail... One that has a bit of replay value. A challenge for you, Sinphaltimus... Write your own CALL CLEAR subprogram, and replace it in the following code chunk: 100 CALL CLEAR 110 PRINT "I CAN WRITE A NEW SUBPROGRAM!!" 120 END Replace CALL CLEAR with a SUB of your own design and call it CLR. I accept. I will complete when I get home from work tonight. Thanks. I would have put it off otherwise. 1 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted September 1, 2016 Share Posted September 1, 2016 Hmmm ... I tried to paste the BASIC code into my TIImageTool, but since you used lowercase letters, it got all subprogram names wrong ("CALL screen" - "SUBPROGRAM NOT FOUND IN 100"). The command words are uppercased, since they are reserved words, but the names could - in principle - be case-sensitive. However, when I enter text in Extended Basic directly, those strings are always changed to uppercase, also the variable names. Is it correct to assume that all non-quoted strings are changed to uppercase? (Also, I'll have to add some special handling for these interleaved "!" comments because until now I assumed that every line can be parsed as a program line.) 1 Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted September 1, 2016 Share Posted September 1, 2016 About that pre-scan that was mentioned. BITD I had a program, I cannot remember it's name or if it was XB or E/A5, but it would take any XB program, and crunch it down in size, remove all REM statements, change long variable names and add that pre-scan command then spit out some real compact code. Does anyone remember it's name or have a link to the program and documentation in PDF format? 1 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 Really cool, sometimes99er!!! Hoping for a new Rabbit Trail... One that has a bit of replay value. Thanks. Putting on my ... 1 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted September 1, 2016 Share Posted September 1, 2016 About that pre-scan that was mentioned. BITD I had a program, I cannot remember it's name or if it was XB or E/A5, but it would take any XB program, and crunch it down in size, remove all REM statements, change long variable names and add that pre-scan command then spit out some real compact code. Does anyone remember it's name or have a link to the program and documentation in PDF format? PrescanIt! 2 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 Hmmm ... I tried to paste the BASIC code into my TIImageTool, but since you used lowercase letters, it got all subprogram names wrong ("CALL screen" - "SUBPROGRAM NOT FOUND IN 100"). The command words are uppercased, since they are reserved words, but the names could - in principle - be case-sensitive. However, when I enter text in Extended Basic directly, those strings are always changed to uppercase, also the variable names. Is it correct to assume that all non-quoted strings are changed to uppercase? Excellent. Good question, sounds plausible, that's all I can say. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted September 1, 2016 Share Posted September 1, 2016 Sometimes, if you have not yet read it, I HIGHLY suggest you read "Watership Down" for some inspiration. One of my all time favorite books. 2 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted September 1, 2016 Share Posted September 1, 2016 (edited) OK, TIMT can now filter out the additional comments; it will only allow a BASIC line without line number when it starts with a ! or REM token and then discard it, hence it will be possible to paste listings with additional non-line comments. For the automatic uppercase translation I'd have to think a bit longer (or you simply stay with uppercase ). Edited September 1, 2016 by mizapf 1 Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted September 1, 2016 Author Share Posted September 1, 2016 Sometimes, if you have not yet read it, I HIGHLY suggest you read "Watership Down" for some inspiration. One of my all time favorite books. Actually I will. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.