Jump to content
IGNORED

one line program - The Wave


arcadeshopper

Recommended Posts

i saw this video on youtube https://www.youtube.com/watch?v=0yKwJJw6Abs and i thought, i can totally do that on the TI.. so..

10 D$="FF" :: FOR D=65 TO 65+8 :: D$="00"&D$ :: CALL CHAR(D,D$) :: NEXT D :: FOR B=1 TO 10 :: PRINT "F";"E";"D";"C";"B";"A";"A";"B";"C";"D";"E";"F";"G"; :: B=1 :: NEXT B

i had to print each character individually to get the required screen movement..

 

Here's xbasic, and compiled..    WAVE is normal extended basic, -X is compiled but loads in extended basic, and -E is EA5 load. looks pretty slick compiled ;) some small screen glitches likely because I'm running classic99 in Wine on a linux pc.. 

 

 

 

WAVE-X WAVE-E WAVE

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

I was never very good at these things and at first I couldn't see how to do this in Forth in one line.  But I had an idea.

 

Full disclosure in Camel99 I have to load the file that changes the system to Graphics mode which is the default in Basic but traditionally not in Forth.

(I could put that in the START file and it would load when you start up Forth but you will have to give me that one or disqualify me as you see fit)  :)

 

I made use of the fact the characters 0 to 8 are undefined so I manually wrote the single line (FF) into each byte of each successive character pattern but bumped 1 byte forward on each character.

 

I used a loop counting up and a loop counting down to emit the characters onto the screen and wrapped the whole thing up in BEGIN AGAIN. No GOTO in Forth.

Type RUN and off it goes. 

It's not quite as fast as compiled BASIC but it's not bad.

 

Thanks for the making an old man think Greg.

 

HEX : RUN   FF 841 800 DO DUP I VC! 9 +LOOP  BEGIN 7 0 DO I EMIT LOOP  0 7 DO I EMIT -1 +LOOP AGAIN ;

 

  • Like 4
Link to comment
Share on other sites

I was never very good at these things and at first I couldn't see how to do this in Forth in one line.  But I had an idea.
 
Full disclosure in Camel99 I have to load the file that changes the system to Graphics mode which is the default in Basic but traditionally not in Forth.
(I could put that in the START file and it would load when you start up Forth but you will have to give me that one or disqualify me as you see fit)  [emoji4]
 
I made use of the fact the characters 0 to 8 are undefined so I manually wrote the single line (FF) into each byte of each successive character pattern but bumped 1 byte forward on each character.
 
I used a loop counting up and a loop counting down to emit the characters onto the screen and wrapped the whole thing up in BEGIN AGAIN. No GOTO in Forth.
Type RUN and off it goes. 
It's not quite as fast as compiled BASIC but it's not bad.
 
Thanks for the making an old man think Greg.
 
HEX : RUN   FF 841 800 DO DUP I VC! 9 +LOOP  BEGIN 7 0 DO I EMIT LOOP  0 7 DO I EMIT -1 +LOOP AGAIN ;

 

Cool!

Sent from my LM-V600 using Tapatalk

  • Thanks 2
Link to comment
Share on other sites

This will be the last one. I promise.

I woke up this morning realizing (maybe just a little obsessive...)  that erasing the character patterns for characters A..G was just a easy with the VFILL operation.

Then you can change the patterns of those letters and just print out the letters. DUH!

 

HEX  : RUN FF  A08 40 2DUP 0 VFILL  BOUNDS DO DUP I VC! 9 +LOOP   BEGIN ." ABCDEFEDCBA" AGAIN ;

 

  • Like 6
Link to comment
Share on other sites

22 hours ago, TheBF said:

I was never very good at these things and at first I couldn't see how to do this in Forth in one line.  But I had an idea.  Full disclosure in Camel99 I have to load the file that changes the system to Graphics mode which is the default in Basic but traditionally not in Forth.  (I could put that in the START file and it would load when you start up Forth but you will have to give me that one or disqualify me as you see fit)  :)

 

I made use of the fact the characters 0 to 8 are undefined so I manually wrote the single line (FF) into each byte of each successive character pattern but bumped 1 byte forward on each character.

 

I used a loop counting up and a loop counting down to emit the characters onto the screen and wrapped the whole thing up in BEGIN AGAIN. No GOTO in Forth.

Type RUN and off it goes.  It's not quite as fast as compiled BASIC but it's not bad.   Thanks for the making an old man think Greg.


HEX : RUN   FF 841 800 DO DUP I VC! 9 +LOOP  BEGIN 7 0 DO I EMIT LOOP  0 7 DO I EMIT -1 +LOOP AGAIN ;

 

 

Had to try in fbForth 2.0:

\ fbForth 2.0
HEX 
: RUN   
   GRAPHICS
   00 841 800 DO 
      DUP I VSBW 
   9 +LOOP  
   BEGIN 
      6 0 DO 
         I EMIT 
      LOOP
      -1 4 DO
         I EMIT 
      -1 +LOOP 
   AGAIN ;

I made a change to >00 at the beginning because my system font has the early characters with all >FF. I also changed the loop parameters to parallel the string in the next example.

 

...lee

  • Like 1
Link to comment
Share on other sites

12 hours ago, TheBF said:

This will be the last one. I promise.  I woke up this morning realizing (maybe just a little obsessive...)  that erasing the character patterns for characters A..G was just a easy with the VFILL operation.

Then you can change the patterns of those letters and just print out the letters. DUH!


HEX  : RUN FF  A08 40 2DUP 0 VFILL  BOUNDS DO DUP I VC! 9 +LOOP   BEGIN ." ABCDEFEDCBA" AGAIN ;

 

 

And, here it is in fbForth 2.0:

\ fbForth 2.0
HEX  
: RUN 
   GRAPHICS
   FF  A08 40 
   OVER OVER 0 VFILL
   OVER + SWAP DO 
      DUP I VSBW 
   9 +LOOP
   BEGIN 
      ." ABCDEFEDCBA" 
   AGAIN ;

...lee

  • Like 3
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...