Jump to content
Vorticon

Official 10 liner program competition thread

Recommended Posts

40 minutes ago, JonnyBritish said:

Can I ask

how many chars can a single line of TI Basic, xb etc contain

 

This is a difficult question to answer.  The hard limit of entry is in the editor, but there are some ways around it.  There are a couple of other posts in another thread which explain.  I will find them and post in a few minutes.

Share this post


Link to post
Share on other sites
2 minutes ago, OLD CS1 said:

Thank you. Just like the 10 line idea, different language but fun to try same thing in Forth...can you write something fun in 10 lines of say 80 chars. Nothing like limited resources to get you thinking more

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

I have wanted to do a version of TETRAVEX for the TI99 for quite a while and this contest gave a good excuse to actually do it. I hope the disk image works; it is from Win994a with the file extension changed to .dsk

TETRAVEX is the 10 line program; TETRADOCS displays the same description you see below. Do not use the LOAD program - that causes the random numbers to be the same.

On the disk I have a load program that gives the option to play the game or read the same docs that are below. The program is still 10 lines so I don't see why this would be a problem, but if it is then I can remove everything but TETRAVEX.

(EDIT) There was a bug that prevented playing a 5x5 game. This has been fixed. This only effected a 5x5 game, which are too hard for me anyway, but if you downloaded the older version you might as well update to this one.

(ANOTHER EDIT) Turns out my fix was not complete. You wouldn't think a 10 line program could cause so much trouble! My testers now report that a 5x5 game plays as it should. Unfortunately the fix slows down the cursor response a bit. The latest version has TVEX at the beginning of line #1.

 

Tetravex

 

Tetravex is an edge-matching puzzle. The objective of the game is to move the tiles in the grid into the proper position.Two tiles can only be placed next to each other if the numbers on adjacent faces match.Use the ESDX keys to move the cursor. Press the space bar to mark the tile you want to move. Move the cursor where you want to place the tile and press the space bar again.  If you solve the puzzle the game will pause for a short time, then restart.

 

The variable S in line 2 determines the size of the grid. S=3 is the default value, giving 9 tiles on a  3x3 grid. You can change S to a value from 2 to 5.


1 TVEX=_ :: DEF U=3*(K=69):: CALL COLOR(1,6,1):: CALL SCREEN(2):: M$=RPT$("80",7)&"FF"&RPT$("01",7):: CALL CHAR(33,"FF"&M$&"0"):: CALL CHAR(36,M$&"FF"&"8142000000004281")
2 S=3 :: RANDOMIZE :: DISPLAY ERASE ALL :: DEF T=64+8*INT(RND*10):: FOR Y=0 TO S :: FOR X=1 TO S :: P=Y*3+4-(Y=0):: CALL VCHAR(P,X*3+16,T,2+(Y=S)):: CALL HCHAR(X*3+3,P+13,T,2+(Y=S)):: NEXT X :: NEXT Y
3 DEF Q=3*INT(S*RND)+5 :: FOR Y=1 TO S :: FOR X=1 TO S :: R=Y*3+2 :: C=X*3+16 :: M=Q-R :: N=Q+14-C :: FOR Z=1 TO 4 :: P=(Z=2):: CALL GCHAR(R,C,G):: CALL GCHAR(R+M,C+N,H):: CALL HCHAR(R,C,H)
4 CALL HCHAR(R+M,C+N,G):: CALL HCHAR(R+P,C-1-3*P,Z+32):: R=R+1+P :: C=C-1-3*P :: NEXT Z :: CALL HCHAR(R-1,C+2,37):: CALL HCHAR(R-2,C-S*3,38):: NEXT X :: NEXT Y :: CALL SCREEN(8)
5 DEF D=3*(K=88):: FOR I=1 TO 10 :: X=ASC(SEG$("BKGJ+#FN/0",I,1)):: CALL COLOR(I+4,2-14*(X>63),(X AND 31)):: CALL CHARPAT(I+47,A$):: CALL CHAR(I*8+56,A$):: NEXT I :: R=6 :: C=19
6 DEF RR=R+U-D :: DEF CC=C-3*L*(C>3)+3*M*(C<30)-L*(C=19)+M*(C=15):: GOSUB 10 :: IF G=38 THEN 6 :: CALL HCHAR(R,C,42):: RF=R :: CF=C :: GOSUB 10 :: CALL HCHAR(RF,CF,35):: IF G<38 THEN 6
7 FOR I=-1 TO 1 :: FOR J=-1 TO 1 :: CALL GCHAR(RF+I,CF+J,G):: CALL HCHAR(RF+I,CF+J,32):: CALL HCHAR(R+I,C+J,G):: NEXT J :: NEXT I :: CALL HCHAR(RF,CF,38):: CALL HCHAR(R,C,35):: IF C>17 THEN 9
8 DEF RO=(I=1)-(I=4):: DEF CO=(I=2)-(I=3):: E=0 :: FOR I=1 TO 4 :: CALL GCHAR(R+RO,C+CO,GG):: CALL GCHAR(R+2*RO,C+2*CO,G):: E=E+(G<>GG)*(G<>32):: NEXT I
9 @[email protected]+(C>17)-(CF>17):: IF E<>0 THEN TR=RF :: TC=CF :: RF=R :: CF=C :: R=TR :: C=TC :: E=0 :: GOTO 7 ELSE IF @<S*S THEN 6 :: IF @<155 THEN 9 :: CALL CLEAR :: CALL COLOR(@-150,2,1):: IF @<164 THEN 9 :: RUN
10 CALL GCHAR(R,C,G):: CALL HCHAR(R,C,30):: CALL KEY(0,K,_):: L=(K=83):: M=(K=68):: CALL HCHAR(R,C,G):: IF _=0 THEN 10 :: IF K-_=31 THEN RETURN ELSE CALL GCHAR(RR,CC,GG):: IF GG=32 THEN 10 ELSE R=RR :: C=CC :: GOTO 10

 

 

 

 

 

TETRAVEX.DSK

Edited by senior_falcon
Revision to program
  • Like 1

Share this post


Link to post
Share on other sites

Do not use the LOAD program for TETRAVEX. This causes the random numbers to always be the same. If your disk has LOAD you should delete it and start TETRAVEX or TETRADOCS the usual way - OLD DSK1.TETRAVEX and RUN or RUN "DSK1.TETRAVEX"

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

One of the students was testing out TETRAVEX and found that when playing a 5x5 game the computer would crash. All other sizes worked fine. I'm a little hard of thinking, so I never actually tried playing a game this big. The fix was simply to move everything over one column to the right and now it works fine. The new version is uploaded in post 29.

(Edit July 31, 6:20 EDT) My fix did not completely cure the problems with 5x5. The new version in post #29 has been thoroughly tested and that problem is now fixed.

Edited by senior_falcon
  • Like 2

Share this post


Link to post
Share on other sites

TI Game Engine X

Klaus Lukaschek

Atariage User: kl99

 

Requirements:
Memory: 32K Memory Expansion
Input: Joystick No 1

Cartridge: RXB 2015 E

Preferred Emulator: Classic99 (developed and tested so far)


You need to reach the end of the Level. You can move to the left and to the right. You can Jump and you will fall down, whenever there is no platform below you. The end of the level is always on the far right, and the game is scrolling automatically to the left. So be quick.

 

You can combine a Jump with a move to the right or left to reach a higher platform next to you.

 

You will loose a life if you fall into the ground or if you get stuck because of the automatic scrolling.

 

You have got 3 lives and have to do the whole level in one attempt.

 

Player Movement:
Joystick Left: Moving Left
Joystick Right: Moving Right
Joystick Fire: Jump

 

This game is inspired by a Game & Watch LCD Handheld called Super Mario Bros, released by Nintendo.

 

The game was created specifically in mind to participate in a Extended Basic Programming Contest, taking place in 2019.
The contest was about creating a game with a maximum of 10 lines of code.

 

This game as such is under Copyright of Klaus Lukaschek.

 

Thanks to Vorticon for hosting the contest, Tursi for the Classic99 Emulator, Mike Wight for making The Cyc, Matthew Hagerty and Marc Hull and Tursi for sharing their Sound Programming Knowledge, Rich Gilbertson for creating his RXB, Ciro Barile for inspiration and motivation and testing, my wife Sandra for her support, my brother Reinhard for learning how to program together.

 

I would love to have had some more time as the released version is running a very small level.

 

Some Tech Talk:

  • Multiple Statements per Line
  • Usage of Variables instead of direct Numbers Constants to win Line Length in critical areas
  • Scrolling part of the screen to the left by using CALL MOVES to copy bytes from VDP Ram to VDP Ram
  • Usage of Logical AND and OR in several places
  • Logical AND is used for bitwise operations
  • Sharing of Program Lines 8-10 for being called via GOSUB with a conditional RETURN or called as normal flow after processing Line 7.
  • Storing a repeating sound list in VDP Ram to be called by the Interrupt Service Routine.
  • CALL IO to talk to the Soundchip.
  • Soundlist is not stored in hexadecimal form to have 1 Byte consuming only 1 Byte, for this a transformation of the string is necessary.
  • Level Data consumes 1 Byte per Column
  • Definition and update of Player Sprite Location via CALL POKEV instead of CALL SPRITE and CALL LOCATE
  • Check for Level collision via CALL PEEKV instead of CALL GCHAR
  • Trimmed any '0' in the end of a CALL CHAR definition.
  • All numeric variables (constants) only have one character as their name.
  • Usage of _ and [ and ] and @ as variable names.
  • Usage of the system timer in >8379 to sync actions.
  • The game is actually an engine, limited to only containing one level for contest reason, therefore many levels can be created.
  • The name X refers to 10 meaning creating a Game Engine with only 10 lines of code.

GAMEENGX.dsk

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

TI Game Engine X
identical to Disk Image Content (OLD DSK1.GAMENGINEX)

1 _=0 :: K=1 :: H=4 :: I=8 :: M=H*I :: B=M-I :: D=52 :: L$="-(([email protected](""@MB,""TMJB<PH\BGH\""^BJHE_"
2 F=230 :: GOSUB 8 :: G=C*I :: CALL CHAR(M+K,RPT$("38",7),94,"0000000000FEFEFE0",C,P$):: S$="CjEpECjEJCgDpECgDJCgDpJCgDTCjEpECjEJCgDpECgDJClCpEClC^[email protected]\"
3 FOR T=K TO C-B+K :: Y=ASC(SEG$(S$,T,K)):: T$=T$&CHR$(Y-(Y>63)*(Y<C)*I*I-(Y>C)*M):: NEXT T :: CALL MOVES("$V",T,T$,1760):: A=-31879 :: FOR N=K TO M-K :: CALL VCHAR(7,N,M,H+I,B-J,N,120,48):: NEXT N
4 IF X=_ THEN CALL MAGNIFY(L):: X=J*J :: Y=59 :: CALL IO(K,1760)ELSE IF (@+K=LEN(L$))THEN END ELSE IF (X<J)+(Y>107)THEN CALL POKEV(G+L,Q AND K):: CALL SOUND(-C,-K,_):: S=_ :: Q=Q+K :: IF Q<H*H THEN 4 ELSE X=_ :: ]=]-K :: IF ]<K THEN END ELSE GOTO 4
5 U=K :: S=S+K :: Z=ASC(SEG$(L$,S,K))-M :: FOR R=I TO 14 STEP L :: CALL VCHAR(R,J*J,M-((Z AND U)>_),L):: CALL HCHAR(R+2,B+2,95+((Z AND U+U)>_),H):: U=U*H :: NEXT R :: Q=_ :: CALL LOAD(A,_):: IF S=K THEN 9
6 CALL KEY(K,W,O):: CALL JOYST(K,U,R):: IF O+U=_ THEN 8 :: IF O=_ THEN 7 :: P=Y*H+X+D :: CALL PEEKV(P,V):: CALL PEEKV(P-C,W):: IF (V=E)+(W<>E)THEN 7 :: Y=Y-I*L :: CALL POKEV(G,Y):: Q=K
7 IF U=_ THEN 8 :: P=Y*H+X+D :: CALL PEEKV(P,V):: CALL PEEKV(P-K-(U=H)*J,W):: IF (W<>M*H)OR((V=E)*(Q=_))THEN 8 :: Q=_ :: X=MIN(MAX(J,X+SGN(U)*J),J*J):: CALL POKEV(G+K,X*I+L)
8 IF [=K THEN CALL PEEK(A,T):: IF T<I*J THEN 6 ELSE @=S :: X=X-J :: IF X>_ THEN 9 ELSE P=Y*H+61 :: CALL PEEKV(P,V):: X=2-L*(V=M*H)ELSE P$="070F1F3F2D2510187F988D4D3F4F4438E0F8FCFE5C5008C8F0ACB2BAF4E4887"
9 CALL MOVES(M$,B,F,F-J,M$,B,F+M,257,M$,B,294,289,M$,B,F+C,321,M$,B,358,353,M$,B,390,385,M$,B,422,417,M$,B,454,449,M$,B,486,481)
10 IF [=K THEN CALL POKEV(G,Y,X*I+L,C+C,K):: P=Y*H+X+D :: CALL PEEKV(P,V):: IF (Y>108)+(V=190)THEN 4 ELSE Y=Y+I*L :: CALL POKEV(G,Y):: GOTO 10 ELSE E=191 :: J=5 :: M$="VV" :: [=K :: L=3 :: ]=L :: C=M*L :: RETURN


Please ensure that your system&emulator pasting feature respects the seven Ascii Code 127 characters within the S$ string in Line 2.
For the Js99er Emulator check for the FPS rate to ensure the correct speed. It runs considerable slower in the attached RXB version in Js99er.
I used Classic99 for development and testing.

And as stated before. It is actually an Engine which includes a short level. And I realized reaching the end of the level is not done nicely in the released version.

I will document how different levels can be created.

 

Editing Notes:

I figured out that atariage.com cannot handled Ascii Code 127 at all, which is part of the String Definition for the Autosound.

I therefore removed the Full Text version for copying via clipboard as it can not be copied like that. Sorry for that confusion.

 

Further, I created a dedicated Discussion Thread for the release with informations and updates like a decent Level and Levelcreation guide:

 

Edited by kl99
  • Like 3

Share this post


Link to post
Share on other sites

The contest is now officially closed. We have 12 Extended Basic entries and 4 TI Basic entries. Thank you all for your participation!

I will be reviewing all the entries over the next couple of days for eligibility and formatting then create a poll for voting.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hello all,

 

How do I upload the program "TIP" into V9T9 or Classic99? I am unable to upload this program into either of the two simulation apps. In Classic99 I get following error message: "*WARNING: CHECK PROGRAM IN MEMORY    *I/O ERROR 57"

 

 

Regards

Edited by MueThor

Share this post


Link to post
Share on other sites
Posted (edited)
6 hours ago, MueThor said:

Hello all,

 

How do I upload the program "TIP" into V9T9 or Classic99? I am unable to upload this program into either of the two simulation apps. In Classic99 I get following error message: "*WARNING: CHECK PROGRAM IN MEMORY    *I/O ERROR 57"

 

 

Regards

hi,

not sure how you got to *I/O ERROR 57

 

The file is a FIAD not .DSK

 

here, try this...

 

TIP.dsk program name is: TIP

:)

Edited by HOME AUTOMATION

Share this post


Link to post
Share on other sites
7 hours ago, MueThor said:

Hello all,

 

How do I upload the program "TIP" into V9T9 or Classic99? I am unable to upload this program into either of the two simulation apps. In Classic99 I get following error message: "*WARNING: CHECK PROGRAM IN MEMORY    *I/O ERROR 57"

 

 

Regards

Check out Post #4 in "10 Liner BASIC/XB contest VOTING POLL". The 16 programs are all bundled together along with the docs. You can use FIAD or a disk image.

Share this post


Link to post
Share on other sites

Dear HOME AUTOMATION, senior_falcon and all others,

 

Thank you for your help. I finally got the programs to run on at least one of the two apps (V9T9 and Classic99). Now, when joysticks are needed for the games, does there exist a sort of module for the apps to replace these joysticks by keys of the keyboard?

 

 

Regards,

 

Share this post


Link to post
Share on other sites
57 minutes ago, MueThor said:

Dear HOME AUTOMATION, senior_falcon and all others,

 

Thank you for your help. I finally got the programs to run on at least one of the two apps (V9T9 and Classic99). Now, when joysticks are needed for the games, does there exist a sort of module for the apps to replace these joysticks by keys of the keyboard?

 

 

Regards,

 

Typically the Emulator maps or lets you map the Joystick Up, Down, Left, Right to the Keyboard Keys Up, Down, Left, Right.

And on the TI-99/4A the Key Q is the Joystick 1 Fire Button.

At least for Classic99 there is Options\Options and then Enable Joystick and whether you want to use the PC Keyboard for it instead.

Share this post


Link to post
Share on other sites

I actually started a TI-basic game and seemed like I needed about 15+ lines to do what I wanted.  I don't think I could've quite done it in 10 lines, but the lack of RPT$ totally killed my project. 

Share this post


Link to post
Share on other sites

Watching Tursi struggle with Tetravex made me realize that the instructions are not clear to someone who has never seen this game. This description should make it more clear:

 

"Tetravex is an edge-matching puzzle. The objective of the game is to move the tiles from the right hand grid to the empty grid on the left. Move the cursor with the ESDX keys. Press the space bar to mark the tile you want to move. Move the cursor to an empty position in either grid. Press the space bar to move the tile. In the left grid the numbers on adjacent faces of the tiles must match. The puzzle is solved when all the tiles are in the left hand grid. The game will then restart after a short pause."

  • Like 2

Share this post


Link to post
Share on other sites
19 hours ago, senior_falcon said:

Watching Tursi struggle with Tetravex made me realize that the instructions are not clear to someone who has never seen this game. This description should make it more clear:

 

"Tetravex is an edge-matching puzzle. The objective of the game is to move the tiles from the right hand grid to the empty grid on the left. Move the cursor with the ESDX keys. Press the space bar to mark the tile you want to move. Move the cursor to an empty position in either grid. Press the space bar to move the tile. In the left grid the numbers on adjacent faces of the tiles must match. The puzzle is solved when all the tiles are in the left hand grid. The game will then restart after a short pause."

Tetravex is a very clever bit of programming and challenging as well. Surprised you could do it in 10 lines!

  • Like 1

Share this post


Link to post
Share on other sites
On 6/4/2019 at 8:31 AM, Vorticon said:

Please use this post only for final entry submissions. You may enter as many programs as you want. Please do not post comments here!

 

Rules

  • Games should be programmed in either TI BASIC or any version of Extended Basic currently available.
  • Maximum total length of the program cannot exceed 10 lines, including DATA statements
  • Disk or other storage access is NOT allowed. You must only use the facilities available within TI BASIC or the particular XB cartridge you chose.
  • Entry format: Programs should be submitted as a disk image for ease of access by all. Make sure to state the running environment (TI BASIC, TIXB, RXB etc...). Also include the name or AA handle you wish to use for credit.
  • Submission deadline: July 31st, 2019 midnight GMT
  • Judging: A public poll will be created on this forum with all the eligible entries at the end of the contest, separated into 2 categories: TI BASIC and Extended Basic. The winning entry in each category will be the one with the highest number of votes.
  • Prizes: 1x NIB Atari Flashback Blast! Volume 1 and 1x NIB Activision Flashback Blast! (winners will decide who gets what among themselves).
  • Most of all, have fun!!!

Awesome BASIC 10 liner contest for the TI! This is a fascinating machine, I really liked it bitd and never had one but one of my best friends did so I got to enjoy it.

 

It's a lot of fun reading these BASIC 10 liner listings, particularly when they are pure BASIC and uncompressed like Mastermind and Microtower above, it would be great to see vids of the games too! :)

 

In the spirit of the 10 line BASIC comp and Atari Flashback prizes theme I have an Atari Flashback BASIC development kit (compiler and IDE) available here:

http://relationalframework.com/Atari2600gamesonline.htm

 

Have fun writing BASIC 10 liners and larger games for the Atari Flashback! :) (Atari Flashback BASIC is compatible with all Flashbacks and classic 2600 consoles).

 

Share this post


Link to post
Share on other sites

Yeah it's fun to see all the creativity come out through the contest.

I'll have to take a look at your development kit. Sounds super interesting!

Share this post


Link to post
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.

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...