This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-06-05 23:23:47

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Basic

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  tongue ) 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!


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#2 2010-06-06 00:00:24

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Basic

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.   smile   You can read my BASIC compiler in Logo for a discussion of the language capabilities and limits, with simple examples of BASIC programs.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#3 2010-06-06 00:06:16

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

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


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#4 2010-06-06 00:54:15

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Basic

ScratchReallyROCKS wrote:

Now honestly, do you think this is possible to make in BYOB?

smile

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.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5 2010-06-06 08:59:16

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

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) smile


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#6 2010-06-06 14:08:31

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

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


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#7 2010-06-06 16:09:02

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Basic

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.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#8 2010-06-06 16:10:32

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Basic

Here:
http://upload.wikimedia.org/wikipedia/commons/8/85/AtariBasicExample.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 END

Last edited by johnnydean1 (2010-06-06 16:11:19)


You can now reach me on Twitter @johnnydean1_

Offline

 

#9 2010-06-06 17:38:39

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

johnnydean1 wrote:

Here:
http://upload.wikimedia.org/wikipedia/commons/8/85/AtariBasicExample.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 END

Thanks!


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#10 2010-06-06 18:48:16

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: Basic

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 END

Thanks!

That looks like either commodore or an atari...


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#11 2010-06-06 21:19:35

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

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

Last edited by ScratchReallyROCKS (2010-06-06 21:21:04)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#12 2010-06-06 21:31:24

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: Basic

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

'd work on getting it working before encoding the output file  big_smile


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#13 2010-06-06 21:40:38

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

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

'd work on getting it working before encoding the output file  big_smile

Yeah I don't think I will encode it anyway.  big_smile  (pass on the smiley!)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#14 2010-06-06 21:59:52

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: Basic

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

'd work on getting it working before encoding the output file  big_smile

Yeah I don't think I will encode it anyway.  big_smile  (pass on the smiley!)

Okay! :D
What?

Offline

 

#15 2010-06-06 22:03:38

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

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  big_smile )


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#16 2010-06-07 16:43:02

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Basic

This should be really interesting! I look forward to seeing the final product  smile

Offline

 

#17 2010-06-07 16:45:34

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Basic

If you need help tell me and Ill have a go  big_smile .


(Tell me on a comment on 1 of my porjects)


You can now reach me on Twitter @johnnydean1_

Offline

 

#18 2010-06-07 17:18:30

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Basic

johnnydean1 wrote:

If you need help tell me and Ill have a go  big_smile .


(Tell me on a comment on 1 of my porjects)

Okay!


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

Board footer