Jump to content
IGNORED

Challange 2022!


oddemann

Recommended Posts

"New Years rockets" - In Basic and Ex Basic?
Make a program that sends up a rocket. From RND height it explodes and then it explodes into RND "one pixels" that goes outwards from the explosion. It can be very simple or very fancy.
Basically a new years rocket that explodes!

This challenge is meant as a competition to find good and optimal codes. I was also thinking that we then have a vote of, Best programming, Best visual program, Best simple program and the Most fancy! Or something like that!

 

A picture I got this year... as inspiration... ?!?! :D

 

 

_  -  * * * o  O  o * * *  -  _

And I also have a question... I was looking at "Optimizing Line Count in TI BASIC: Type-in Fun with the TI-99/4A" and I was impressed how he reduced 41 lines of code to 7 and used Boolean Logic. And I was thinking... We should make a tread where we ONLY put in "optimal code". Like this "detect key pressed code" in 2 lines. There is no reason to invent "black powder" over and over again. So this tread, "Optimal code" is filled with code that saves time and space. So in the future, when people want to make a program, one can copy snippets of code to make programs smarter and better. Or learn programming. I am thinking of making one tread for all. Basic, EX, Assembler and more. All in one. And then explain the code so people can use it and change it to fit user/program.

I think that a collection of code snippets will help people make better programs and also to just make program. Resonantly there have been asked for help with a program and maybe by pointing people to a tread like this, would save some "frustration" and also the need for not so nice comments.

Should I make the tread... "Optimal Code Snippets (OCS)"?


_  -  * * * o  O  o * * *  -  _

 

I was so impressed by:
XXX CALL KEY(0,Z,X)

XXX R=R-((Z=85)*(R>1))+((Z=68)*(R<24))-(R=0)

XXX C=C-((Z=76)*(C>1))+((Z=82)*(C<32))-(C=0)

XXX CALL HCHAR(R,C,128)
How he compressed many lines into 2 lines to detect key pressed. I could not have done it. I understand it, but I would never have been able to get to this myself. And then in a "Optimal code" tread, this is explained so that others could copy it and make it fit in there own program. I don't know if this person is here. But I could type it in and explain how it works and how one could change it (what the variables are).

TI INSP.png

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I really like the contest idea.  Simple, but fun.  I'm in an "XB demo" state of mind, at the moment, after all :P

 

As far as optimal code, though, it strikes me that's pretty hard to pin down in a generalised way.  Since even in BASIC, you can optimise for execution speed, use of stack space, use program space, readability, etc.  And oftentimes, these interests run straightforwardly contrary to one another.  Everything's a trade-off, depending on your goals and limitations. 

 

Not too worried about all that from the standpoint of a "build the coolest New Years demo" contest goes, though.  That just sounds like straight-up fun regardless. 

  • Like 2
Link to comment
Share on other sites

My TI Basic "Happy new year!" program! (It would look nicer with sprites, maybe later :D )

I feel it is very "brut force", as I have a feeling it could be done more cleanly. But... this is my skill lvl. Not that happy with it, as my imagination is limited by my skill in programming. But... I am happy with it! I got to do what I wanted! I might clean it up later and make it a little more nice to look at.
 

 

Spoiler

95 RANDOMIZE
100 CALL CLEAR
110 PRINT "       Happy new year!"
115 PRINT "May 2022 be your best year!"
116 GOSUB 1000
120 FOR I=1 TO 28
130 PRINT
140 NEXT I
160 PRINT "3"
161 GOSUB 1000
165 CALL CLEAR
170 PRINT "2"
171 GOSUB 1000
175 CALL CLEAR
180 PRINT "1"
181 GOSUB 1000
185 CALL CLEAR
190 PRINT "GO!"
191 GOSUB 1000
192 CALL CLEAR
193 CALL SCREEN(2)
194 CALL COLOR(1,16,1)
195 CALL COLOR(2,16,1)
196 CALL COLOR(5,16,1)
197 CALL COLOR(6,16,1)
198 FOR RU=1 TO 5
199 BR=INT(21*RND)+6
200 HO=INT(11*RND)+6
201 CALL CLEAR
202 FOR CO=21 TO HO STEP -1
210 CALL HCHAR(CO,BR,65,1)
220 CALL HCHAR(CO+1,BR,72,1)
230 CALL HCHAR(CO+2,BR,33,1)
235 CALL HCHAR(CO+3,BR,32,1)
236 CL=CO
240 NEXT CO
250 FOR C=1 TO 3
260 CALL HCHAR(CL,BR,32,1)
265 CL=CL+1
270 NEXT C
260 CALL HCHAR(CL,BR,32,1)
280 REM EXPLOTION
290 CALL HCHAR(CL-3,BR,42,1)
300 EX=CL+3
310 FOR RI=1 TO 3
315 CALL CLEAR
320 CALL HCHAR(CO+RI,BR-RI,42,1)
330 CALL HCHAR(CO+RI,BR,42,1)
340 CALL HCHAR(CO+RI,BR+RI,42,1)
350 CALL HCHAR(CO,BR-RI,42,1)
360 CALL HCHAR(CO,BR+RI,42,1)
370 CALL HCHAR(CO-RI,BR-RI,42,1)
380 CALL HCHAR(CO-RI,BR,42,1)
390 CALL HCHAR(CO-RI,BR+RI,42,1)
391 FOR FA=1 TO 3
392 FAR=INT(RND*13)+3
393 CALL COLOR(2,FAR,1)
394 NEXT FA
400 NEXT RI
410 REM FADE OUT
460 CALL COLOR(2,15,1)
470 FOR SY=1 TO 3
475 CALL CLEAR
480 CALL HCHAR((CO-RI)+SY,BR-RI,42,1)
490 CALL HCHAR((CO-RI)+SY,BR,42,1)
500 CALL HCHAR((CO-RI)+SY,BR+RI,42,1)
510 CALL HCHAR((CO)+SY,BR-RI,42,1)
520 CALL HCHAR((CO)+SY,BR+RI,42,1)
530 CALL HCHAR((CO+RI)+SY,BR-RI,42,1)
540 CALL HCHAR((CO+RI)+SY,BR,42,1)
550 CALL HCHAR((CO+RI)+SY,BR+RI,42,1)
560 NEXT SY
570 NEXT RU

999 END
1000 FOR PU=1 TO 500
1010 NEXT PU
1020 RETURN

 

 

Edited by oddemann
Bugs
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

10 hours ago, pixelpedant said:

I really like the contest idea.  Simple, but fun.  I'm in an "XB demo" state of mind, at the moment, after all :P

 

As far as optimal code, though, it strikes me that's pretty hard to pin down in a generalised way.  Since even in BASIC, you can optimise for execution speed, use of stack space, use program space, readability, etc.  And oftentimes, these interests run straightforwardly contrary to one another.  Everything's a trade-off, depending on your goals and limitations. 

 

Not too worried about all that from the standpoint of a "build the coolest New Years demo" contest goes, though.  That just sounds like straight-up fun regardless. 

Very nice presentation of the TI's sound skills ;)

  • Like 1
Link to comment
Share on other sites

14 hours ago, pixelpedant said:

I really like the contest idea.  Simple, but fun.  I'm in an "XB demo" state of mind, at the moment, after all :P

 

As far as optimal code, though, it strikes me that's pretty hard to pin down in a generalised way.  Since even in BASIC, you can optimise for execution speed, use of stack space, use program space, readability, etc.  And oftentimes, these interests run straightforwardly contrary to one another.  Everything's a trade-off, depending on your goals and limitations. 

 

Not too worried about all that from the standpoint of a "build the coolest New Years demo" contest goes, though.  That just sounds like straight-up fun regardless. 

When I clicked on your link I got an ad for Speechelo.  https://speechelo.com

OMG. 

40 years after our favourite speech synthesizer we have this.

  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...