Jump to content
IGNORED

My simple chess game in AtariSoft BASIC


nanochess

Recommended Posts

Hi all.

 

Just wanted to share a memory.

 

In 1987, I was age 8 and went to my friend's house, and we were looking for something to play, so I suggested chess, but he didn't had his chessboard.

 

But he had an Atari 800, so I started coding a BASIC chess program for two players. Well, saying it was a chess program is a little of over-stretch, as basically it only received starting and ending coordinates of movements without any validation.

 

When finished we played two games there. And he went out of the room, and I typed NEW to enter a new program. He came back with a notebook to take note of the program, and when he saw the program wasn't there anymore, he throw a tantrum!

 

Anyway, just a few weeks ago I recoded the program from memory (probably the constants and variable names aren't the same), and sent a copy to him (thirty years later!), and he is happy of having it. ?

 

P.S: Forgot to add a REM saying who did it, but anyway you saw it here first ;)

 

P.S.2: The piece names are in Spanish, easy to change. Sorry! :grin:

 

chess_basic_1.png

chess_basic_2.png

chess_basic_3.png

chess_basic_4.png

Edited by nanochess
  • Like 8
Link to comment
Share on other sites

8 hours ago, nanochess said:

 

Anyway, just a few weeks ago I recoded the program from memory (probably the constants and variable names aren't the same), and sent a copy to him (thirty years later!), and he is happy of having it. ?

 

 

chess_basic_1.png

chess_basic_2.png

chess_basic_3.png

chess_basic_4.png

I took the liberty of revamping your code. I did this with TurboBASIC, but it's Atari BASIC. Just explaining for FOR NEXT loop formatting.

IMG_0031-1.jpg

  • Thanks 1
Link to comment
Share on other sites

12 hours ago, Mrshoujo said:

I took the liberty of revamping your code. I did this with TurboBASIC, but it's Atari BASIC. Just explaining for FOR NEXT loop formatting.

IMG_0031-1.jpg

Of course! You cannot READ directly to the arrays but through a variable, and there's no MID$ like in Microsoft BASIC. I find extremely curious the fact you need to DIM the B$ string.

 

Well, you have solved a 35 years long doubt on my mind ?? My friend didn't had at hand the reference manual of Atari BASIC, so I never could get to work READ/DATA that day. Even less the string access.

 

Supposing the PRINT CHR$(125) is CLS

Edited by nanochess
  • Like 1
Link to comment
Share on other sites

14 hours ago, nanochess said:

Of course! You cannot READ directly to the arrays but through a variable, and there's no MID$ like in Microsoft BASIC. I find extremely curious the fact you need to DIM the B$ string.

 

Well, you have solved a 35 years long doubt on my mind ?? My friend didn't had at hand the reference manual of Atari BASIC, so I never could get to work READ/DATA that day. Even less the string access.

 

Supposing the PRINT CHR$(125) is CLS

Atari BASIC uses strings like 1 long array. It's how you use them which matters. It's rather powerful when you get the concept. An entire 1024 character string can be set to all the same character by 1 line and happens lightning fast. Each character is 1 byte as opposed to numerical variables which take 6 in BCD.

 

In order to use a string variable, you have to DIM it first. Atari BASIC just works like that. Not unlike some programming languages where you have to declare all variables and their types.

 

When reading from a list in DATA, everything can be read as a string, but only numbers can be read as numbers. You can mix types, like a number and a text string. Just have to keep them straight.

 

Yes, ?CHR$(125) is Clear Screen. I was using Altirra and I don't know the keypress to make that character appear. I need to get a guide and print it.

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

8 hours ago, Larry said:

Can you SAVE the program and post it here?  I'd like to take a closer look without typing it in (and a few other folks probably would too).  You might even get some worthwhile suggestions.

I don't have an idea how to do it, but I'll research into it.

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