I'm working on (trying) to make BASIC (Beginner's All-purpose Symbolic Instruction Code) in Scratch. BASIC was made in 1964 for schools (I'm pretty sure
) and was pretty much the first higher-level programming language out there. Now I'm trying to replicate it in Scratch (actually BYOB) and I need help. Not really with the scripting, but I need to know what it originally looked like (mostly the syntax), and how it worked and what it's limits were. Here are the people helping so far:
ScratchReallyROCKS
Come on people, you know you want to help!
Offline
ScratchReallyROCKS wrote:
I'm working on (trying) to make BASIC (Beginner's All-purpose Symbolic Instruction Code) in Scratch... I need to know what it originally looked like (mostly the syntax), and how it worked and what its limits were.
Well, you've come to the right place.
You can read my BASIC compiler in Logo for a discussion of the language capabilities and limits, with simple examples of BASIC programs.
Offline
bharvey wrote:
ScratchReallyROCKS wrote:
I'm working on (trying) to make BASIC (Beginner's All-purpose Symbolic Instruction Code) in Scratch... I need to know what it originally looked like (mostly the syntax), and how it worked and what its limits were.
Well, you've come to the right place.
You can read my BASIC compiler in Logo for a discussion of the language capabilities and limits, with simple examples of BASIC programs.
Thanks! This should really help.
EDIT: Now honestly, do you think this is possible to make in BYOB?
Last edited by ScratchReallyROCKS (2010-06-06 00:12:58)
Offline
ScratchReallyROCKS wrote:
Now honestly, do you think this is possible to make in BYOB?
The hardest part will be getting the BASIC program text into a form you can use in the BYOB program. Is it going to be interactive? You'll have to write a little text editor. Luckily, because of the line numbers, you only have to edit one line at a time; you can keep a list of line numbers just like my Logo version.
Other than that, in some ways it'll be easier because you have first class procedures in BYOB, whereas in Logo I had to manipulate the text of the program as a list structure. But that means you certainly can't just do it exactly the way I did. You'll have blocks with names like BASIC-PRINT and BASIC-FOR and so on, each of which implements a BASIC command.
Oh, and I totally cheated by letting Logo parse arithmetic expressions. Since arithmetic operations in BYOB are blocks rather than text strings, you'll have to turn the text "a+b" into a call to the + block, etc.
But, yeah, it's doable, I think.
Offline
bharvey wrote:
1) You'll have to write a little text editor
2) Oh, and I totally cheated by letting Logo parse arithmetic expressions. Since arithmetic operations in BYOB are blocks rather than text strings, you'll have to turn the text "a+b" into a call to the + block, etc.
1) I've already made the text editor.
2)
Offline
Does anyone have any pictures of what it looked like (this time I'm not talking about the syntax because I already know what that looks like.)
Offline
ScratchReallyROCKS wrote:
Does anyone have any pictures of what it looked like
You don't need a picture; it was just text, no GUI, back then. Different implementations were different, but basically it would say
READY
as a prompt and then you'd type in either a line with a number in front, to add to the program, or a command like RUN or LIST.
There were implementations that had graphics; basically they would split the screen so you'd have four lines or so of text at the bottom and the rest would be for drawing, which you'd do with a DRAWLINE function (takes x1, y1, x2, y2).
Or alternatively you'd use the POKE function (takes address, value) to write directly into graphics memory.
But I think you should start with a plain text version.
Offline
Here:
And a bit or orignial code:
10 INPUT "What is your name: ", U$
20 PRINT "Hello "; U$
30 INPUT "How many stars do you want: ", N
40 S$ = ""
50 FOR I = 1 TO N
60 S$ = S$ + "*"
70 NEXT I
80 PRINT S$
90 INPUT "Do you want more stars? ", A$
100 IF LEN(A$) = 0 THEN GOTO 90
110 A$ = LEFT$(A$, 1)
120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30
130 PRINT "Goodbye "; U$
140 END
Last edited by johnnydean1 (2010-06-06 16:11:19)
Offline
johnnydean1 wrote:
Here:
And a bit or orignial code:
10 INPUT "What is your name: ", U$
20 PRINT "Hello "; U$
30 INPUT "How many stars do you want: ", N
40 S$ = ""
50 FOR I = 1 TO N
60 S$ = S$ + "*"
70 NEXT I
80 PRINT S$
90 INPUT "Do you want more stars? ", A$
100 IF LEN(A$) = 0 THEN GOTO 90
110 A$ = LEFT$(A$, 1)
120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30
130 PRINT "Goodbye "; U$
140 END
Thanks!
Offline
ScratchReallyROCKS wrote:
johnnydean1 wrote:
Here:
http://upload.wikimedia.org/wikipedia/c … xample.png
And a bit or orignial code:
10 INPUT "What is your name: ", U$
20 PRINT "Hello "; U$
30 INPUT "How many stars do you want: ", N
40 S$ = ""
50 FOR I = 1 TO N
60 S$ = S$ + "*"
70 NEXT I
80 PRINT S$
90 INPUT "Do you want more stars? ", A$
100 IF LEN(A$) = 0 THEN GOTO 90
110 A$ = LEFT$(A$, 1)
120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30
130 PRINT "Goodbye "; U$
140 ENDThanks!
That looks like either commodore or an atari...
Offline
Now that I think of it, I think I'll make BASIC in Panther because of it's file I/O blocks, that way you could have a master file that everything was saved to, like a hard drive.
EDIT: Maybe, just for added pointlessness, that file will be encoded in binary. Please don't ask why.
Last edited by ScratchReallyROCKS (2010-06-06 21:21:04)
Offline
ScratchReallyROCKS wrote:
Now that I think of it, I think I'll make BASIC in Panther because of it's file I/O blocks, that way you could have a master file that everything was saved to, like a hard drive.
EDIT: Maybe, just for added pointlessness, that file will be encoded in binary. Please don't ask why.![]()
'd work on getting it working before encoding the output file
Offline
cds56 wrote:
ScratchReallyROCKS wrote:
Now that I think of it, I think I'll make BASIC in Panther because of it's file I/O blocks, that way you could have a master file that everything was saved to, like a hard drive.
EDIT: Maybe, just for added pointlessness, that file will be encoded in binary. Please don't ask why.![]()
'd work on getting it working before encoding the output file
![]()
Yeah I don't think I will encode it anyway.
(pass on the smiley!)
Offline
ScratchReallyROCKS wrote:
cds56 wrote:
ScratchReallyROCKS wrote:
Now that I think of it, I think I'll make BASIC in Panther because of it's file I/O blocks, that way you could have a master file that everything was saved to, like a hard drive.
EDIT: Maybe, just for added pointlessness, that file will be encoded in binary. Please don't ask why.![]()
'd work on getting it working before encoding the output file
![]()
Yeah I don't think I will encode it anyway.
(pass on the smiley!)
Okay! :D
What?
Offline
ThePCKid wrote:
Okay! :D
What?
Did you turn smilies off or something, and this is kinda getting off topic so please don't post if if isn't something helpful (you can include your passed on smilies in your helpful post
)
Offline
If you need help tell me and Ill have a go
.
(Tell me on a comment on 1 of my porjects)
Offline
johnnydean1 wrote:
If you need help tell me and Ill have a go
.
(Tell me on a comment on 1 of my porjects)
Okay!
Offline