LANTERN's Blog

The 4 functions calculator is finished and download link for the Exe file posted.

It was easy to make, a little later I will see if I can shorten out the code as it is too long now, now it has all 4 functions working.

2 PRINT "Calculator."
3 C = C
4 PRINT "Type: E ( E = Exit) or + or - or X or /"
8 INPUT "Type one of the 5 options and press Enter ";X$
12 IF X$ = "E" THEN 500
30 IF X$ = "+" THEN 50
31 IF X$ = "-" THEN 60
32 IF X$ = "X" THEN 70
33 IF X$ = "/" THEN 80
35 GOTO 4
50 PRINT "Addition": GOTO 100
60 PRINT "Substraction": GOTO 200
70 PRINT "Multiplication": GOTO 300
80 PRINT "Division" : GOTO 400
90 REM Addition Routine
100 PRINT "Right now you have:": PRINT C
101 PRINT "Type a number"
102 PRINT "And press the Enter key"
104 INPUT "To use other function or to Exit enter 0 (Zero)"; A
106 IF A = 0 THEN 4
107 C = C + A
114 GOTO 100
200 REM Substraction Routine
201 PRINT "Right now you have:": PRINT C
202 PRINT "Type a number"
203 PRINT "And press the Enter key"
204 INPUT "To use other function enter 0 (Zero)"; A
206 IF A = 0 THEN 4
210 C = C - A
211 GOTO 201
290 REM Multiplication Routine
300 PRINT "Right now you have:": PRINT C
301 PRINT "Type a number"
302 PRINT "And press the Enter key"
304 INPUT "To use other function or to Exit enter 0 (Zero)"; A
306 IF A = 0 THEN 4
307 C = C * A
314 GOTO 300
390 REM Division Routine
400 PRINT "Right now you have:": PRINT C
401 PRINT "Type a number"
402 PRINT "And press the Enter key"
404 INPUT "To use other function or to Exit enter 0 (Zero)"; A
406 IF A = 0 THEN 4
407 C = C / A
414 GOTO 400
500 END

----------

See how long that code is?

I compacted it:

1 PRINT "Calculator."
2 C = C
3 PRINT "Type: E ( E = Exit) or + or - or X or /"
4 INPUT "Type one of the 5 options and press Enter ";X$
5 IF X$ = "E" THEN 26
6 PRINT "Right now you have:": PRINT C
7 PRINT "Type a number And press the Enter key"
8 INPUT "To use other function or to Exit enter 0 (Zero)"; A
9 IF A = 0 THEN 3
10 IF X$ = "+" THEN 14
11 IF X$ = "-" THEN 17
12 IF X$ = "X" THEN 20
13 IF X$ = "/" THEN 23
14 C = C + A
15 PRINT "Addition"
16 GOTO 6
17 C = C - A
18 PRINT "Substraction"
19 GOTO 6
20 C = C * A
21 PRINT "Multiplication"
22 GOTO 6
23 C = C / A
24 PRINT "Division"
25 GOTO 6
26 END

--------

I tried to make it smaller than this, but could not so far:

1 PRINT "Calculator.":C = C
3 PRINT "Type: E ( E = Exit) or + or - or X or /"
4 INPUT "Type one of the 5 options and press Enter ";X$
5 IF X$ = "E" THEN 26
6 PRINT "Right now you have:": PRINT C
7 PRINT "Type a number And press the Enter key"
8 INPUT "To use other function or to Exit enter 0 (Zero)"; A
9 IF A = 0 THEN 3
10 IF X$ = "+" THEN 14
11 IF X$ = "-" THEN 17
12 IF X$ = "X" THEN 20
13 IF X$ = "/" THEN 23
14 C = C + A:PRINT "Addition":GOTO 6
17 C = C - A:PRINT "Substraction":GOTO 6
20 C = C * A:PRINT "Multiplication":GOTO 6
23 C = C / A:PRINT "Division":GOTO 6
26 END

--------------

Download link of the finished calculator's Exe file:

Download link good for 7 days only!

http://wikisend.com/download/601206/Fernando'sCalculator1.00.exe

-----------

As seen, even simple old basic with line numbers and all has its uses, RJOh uses it also.

It is not so much the programming language used, but how it is used that matters the most, well, up to a point, old programming languages have some limitations, it also depends on the compiler if you compile it.

Maybe I do have a mind for programming and I still know next to nothing about programming and also about Math.

Entry #339

Trump for president?

Why not? People wil vote for anybody, same as has always been done and probably has as most of a chance as just about anybody out there right now, well some have even less of a chance than him, but too early to say much of anything about it.

Seems to me that as this time probably Trump has no less of a chance than Obama at getting elected at the next time, not that Obama has a great chance nor anything, but too early yet.

----------

As to the old basic posts, I don't yet know, but they might be over, even if they are not finished yet.

As RJOH has said in the old days there was a lot of basic info and examples that a person could study, most of that is now gone, if I had kept at it like RJOH I would also had learned old basic programming and I do think that I had enough ability that I would have been able to do it in time little by little, but it takes so very much study, thinking and practice, I am already getting tired of this as it is and besides it probably is just a waste of time as there is no way that I can learn enough as there is just not enough info nor support and most or all people keep that they already know to themselves, even on the old days relatively few people knew enough and were good enough to make any kinds of good programs other than maybe make some few more or less good games, I don't remember ever seen any lottery related programs on the books and magazines.

As for non lottery applications there already are many of them, good lottery programs there are not enough of them yet.

I don't think that many people read the posts of most people, the views (hits) are probably just from the search engines looking for info when ever they are used by people.

For the most part the blogs are just for people to keep info there for their own use, as any time later is more or less easy to find have you have put there unless you are like some who have way to many posts and who fill their blogs with thousands of trash posts.

Most of the info on forums, blogs and on the Internet is just trash, but the same applies to news, newspapers, magazines, radio and T.V, that is life.

Entry #338

10th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

Entering Data.

-----------------------

--------------------------

The INPUT keyword

This keyword prints a ? mark and positions the cursor 2 spaces to the right of the ?.

Samples:

String variable A$

10 PRINT "Input the name of a fruit":INPUT A$
20 PRINT "You printed "A$

------------


                         **** COMMODORE 64 BASIC V2 ****

                      64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT "Input the name of a fruit":INPUT A$
20 PRINT "You printed "A$
RUN
Input the name of a fruit
? Banana

You printed Banana

READY.

----------

Numeric variable A

10 PRINT"Enter a number between 1 and 10": INPUT A
20 PRINT "You printed" A

------------------


                         **** COMMODORE 64 BASIC V2 ****

                      64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT"Enter a number between 1 and 10": INPUT A
20 PRINT "You printed" A
RUN
Enter a number between 1 and 10
? 4

You printed 4

READY.

-------


                         **** COMMODORE 64 BASIC V2 ****

                      64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.

After reading and trying several things I came out with these, it seems to me that people who use the INPUT command don't give enough information to people on their programs so they will know what to use as INPUT and also maybe about the output.


1 PRINT "Type 2 numbers between 1 and 100"
2 PRINT "One number at a time"
3 PRINT "And press the Enter key after typing each number"
4 INPUT "First Number "; A
5 INPUT "Second Number "; B
6 PRINT "First"A ", " "Second"B
RUN
Type 2 numbers between 1 and 100
One number at a time
And press the Enter key after typing each number
First Number ? 47

Second Number ? 16

First 47 , Second 16

READY.

That program of course didn't do anything as it is, but it is just a basic example.

---------------

EXAMPLE 1:
100 INPUT A
110 INPUT B,C,D
120 INPUT "PROMPT";E

                                                         24
~
                       When this program runs, the question mark appears to prompt
the operator that the VIC is expecting an input for line 100. Any
number typed in goes into A, for later use in the program. If the
answer typed was not a number, the ?REDO FROM START
message appears, which means that a string was received when a
number was expected. If the operator just hit RETURN without
typing anything, the variable's value doesn't change.
                       Now the next question mark, for line 110, appears. If we type only
one number and hit RETURN, the VIC will now display 2 question
marks (??), which means that more input is required. You can just
type as many inputs as you need separated by commas, which
prevents the double question mark from appearing. If you type
more data than the INPUT statement requested, the ?EXTRA
IGNORED message appears, which means that the extra items
you typed were not put into any variables.
                       Line 120 displays the word PROMPT before the question mark
appears. The semicolon is required between the prompt and any
list of variables. Note: The only way to end a program during
an INPUT statement is to hold down the RUN/STOP key and
hit RESTORE.

EXAMPLE 2:
10 PRINT "INPUT A WORD":INPUT A$
20 PRINT "YOUR INPUT WAS"A$
30 GOTO 10

------------------

That is simple stuff, but when used in programs with other keyword commands the "Program's logic becomes more complicated"

That might be seen later maybe.

This is all on this for now.

Once you know how to use, the keyword commands by themselves more or less, then you can try to put them together into longer and more complex programs, it is all about the logic of what you want done and or trying to do.

Look at small and also at long programs and try to follow the "Commands Logic", that is the programs' logic, in other words what is being done in "Execution of the commands" and how it is being done, for some people like maybe me it might be easier said than done, so it might be better to start slow and small.

--------------

There are many views, but as Todd says, it might mostly be due to the search engines always making many hits as they index all the data on web pages all over the Internet.

I wonder if some people are really reading this posts and trying to learn from them, you know, it is not very easy to come by data such as this, nowdays mostly it being such an old kind of info, not so easy to find and yet it might be basic programming info and still of some use, after all people have to start somewhere and this is not as hard nor as strange as some other programming stuff.

After all many people are still using DOS and some form of BASIC programming language.

From what I have heard about a lot can still be done with DOS and some form of BASIC by those who are good about it and who also might be good with Math.

----------------

I also just made this:


    **** COMMODORE 64 BASIC V2 ****

 64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
1 PRINT "Type 2 numbers between 1 and 100"
2 PRINT "One number at a time"
3 PRINT "And press the Enter key after typing each number"
4 INPUT "First Number "; A
5 INPUT "Second Number "; B
6 PRINT "First"A ", " "Second"B
7 C = A+B
8 PRINT " 1ST + 2ND ="; C
RUN
Type 2 numbers between 1 and 100
One number at a time
And press the Enter key after typing each number
First Number ? 35

Second Number ? 60

First 35 , Second 60
 1ST + 2ND = 95

READY.

It adds the 2 inputs, this is my first real program nowdays, but on the old days maybe on the 80s, I did make 1 or more programs, not too complicated,  better than this one, of more use, but nothing really great, it was with the Commodore 64, since then I forgot all that I knew about Basic, but I am relearning a little just now, while making these many posts.

Back then I also leared some about assembly language on the C-64, it was not as hard as some people think that it is, at least for the C-64, I probably would not try that with a 386 + Pc, I only learned and tried some little things, I already forgot all about what little I knew about Assembler, the instructions, decimal, hexadecimal and machine code.

I made it so you can see how things can be made of more use and also more complicated, always make the logic in your mind and or on paper or Note or WordPad and then try it to see if it works and how, if not make changes until it works.

----------

Some of the stuff that is learned with Commore basic works with other basic languages, either as it is or changed some.

-----------------------

I just made the program of more use:

1 PRINT "Type 2 numbers between 1 and 100"
2 PRINT "One number at a time"
3 PRINT "And press the Enter key after typing each number"
4 INPUT "First Number "; A
5 INPUT "Second Number "; B
6 PRINT "First"A ", " "Second"B
7 C = A+B
8 PRINT " 1ST + 2ND ="; C
9 REM Here you would put a code command to clear the screen
10 GOTO 1

--------------

Now it is on a non-ending loop, so you can keep on adding numbers, it only needs the Screen Clear Command that the C-64 has, but that doesn't seem to work with this C-64 basic interpreter.

---------------------------------------

I Just thought about something else and could not let it go, so I have to add it to this:

I just remade the program so it is a sort of adding machine, as I said it is all about "Logic of execution of commands"

If it had the Screen Clear Command on it, it would only show the last results of the totals of the additions, but maybe that is not possible to do here with this interpreter, anyhow as it is, is like having a printing tape so we can check the numbers that were added, just in case of any mistakes:


                **** COMMODORE 64 BASIC V2 ****

             64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
1 PRINT "Type a number"
3 PRINT "And press the Enter key after typing the number"
4 INPUT A
5 A = A + C
6 PRINT A
7 C = A
10 GOTO 1
RUN
Type a number
And press the Enter key after typing the number
? 1

             1
Type a number
And press the Enter key after typing the number
? 1

             2
Type a number
And press the Enter key after typing the number
? 1

             3
Type a number
And press the Enter key after typing the number
? 1

             4
Type a number
And press the Enter key after typing the number
? 1

             5
Type a number
And press the Enter key after typing the number
? 0

             5
Type a number
And press the Enter key after typing the number
? 5

             10
Type a number
And press the Enter key after typing the number
? 5

             15
Type a number
And press the Enter key after typing the number
? 5

             20
Type a number
And press the Enter key after typing the number
? 5

             25
Type a number
And press the Enter key after typing the number
?

-----------------------

Not too bad for somebody who knows next to nothing about programming?

Try it yourself:

0 REM Adding Machine.

1 PRINT "Type a number"
3 PRINT "And press the Enter key after typing the number"
4 INPUT A
5 A = A + C
6 PRINT  "Totals"A
7 C = A
10 GOTO 1

--------------------

The more that you learn, the more that you will be able to do.

--------------

2 PRINT "This is the front end of a very simple unfinished calculator"
4 PRINT "1 = + , 2 = - , 3 = x , 4 = /"
6 PRINT "Type: 1, 2, 3 OR 4"
8 INPUT "Type one of the 4 functions and then press Enter ";X
30 IF X = 1 THEN 50
31 IF X = 2 THEN 60
32 IF X = 3 THEN 70
33 IF X = 4 THEN 80
34 END
50 PRINT "Addition": REM GOTO (Line number)
55 END
60 PRINT "Substraction": REM GOTO (Line number)
65 END
70 PRINT "Multiplication": REM GOTO (Line number)
75 END
80 PRINT "Division": REM GOTO (Line number)
85 END

----------

Try it but as I said it is unfinished it is only the "Front" or first portion, the rest might follow sometime later maybe.

It would use maybe routines such as the one on the program before this one above.

-------------------

It uses very simple logic, but also effective, can you follow it and can you also follow the next unfinished portions (Routines)?

By the way for this particular program those who know how, don't post your own routines , later I want to try to figure them out myself, once I post mine when and if I do then you can post your own, for now keep them to yourself.

--------------------------

I just added the "Addition Routine" portion to it:

1 REM Front or Top Routine

2 PRINT "This is the front end of a very simple unfinished calculator"
4 PRINT "1 = + , 2 = - , 3 = x , 4 = /"
6 PRINT "Type: 1, 2, 3 OR 4"
8 INPUT "Type one of the 4 functions and then press Enter ";X
30 IF X = 1 THEN 50
31 IF X = 2 THEN 60
32 IF X = 3 THEN 70
33 IF X = 4 THEN 80
34 END
50 PRINT "Addition": GOTO 100
55 END
60 PRINT "Substraction"
65 END
70 PRINT "Multiplication"
75 END
80 PRINT "Division"
85 END

90 REM Calculator Addition Routine
100 PRINT "Type a number"
102 PRINT "And press the Enter key after typing the number"
104 INPUT "To use other function enter 0 (Zero) "; A
106 IF A = 0 THEN 4
108 A = A + C
110 PRINT  "Totals"A
112 C = A
114 GOTO 100

Can you still see the execution logic? It is very easy!

----------------------


    **** COMMODORE 64 BASIC V2 ****

 64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
1 REM Front or Top Routine

2 PRINT "This is the front end of a very simple unfinished calculator"
4 PRINT "1 = + , 2 = - , 3 = x , 4 = /"
6 PRINT "Type: 1, 2, 3 OR 4"
8 INPUT "Type one of the 4 functions and then press Enter ";X
30 IF X = 1 THEN 50
31 IF X = 2 THEN 60
32 IF X = 3 THEN 70
33 IF X = 4 THEN 80
34 END
50 PRINT "Addition": GOTO 100
55 END
60 PRINT "Substraction"
65 END
70 PRINT "Multiplication"
75 END
80 PRINT "Division"
85 END

90 REM Calculator Addition Routine
100 PRINT "Type a number"
102 PRINT "And press the Enter key after typing the number"
104 INPUT "To use other function enter 0 (Zero) "; A
106 IF A = 0 THEN 4
108 A = A + C
110 PRINT  "Totals"A
112 C = A
114 GOTO 100
RUN
This is the front end of a very simple unfinished calculator
1 = + , 2 = - , 3 = x , 4 = /
Type: 1, 2, 3 OR 4
Type one of the 4 functions and then press Enter ? 1

Addition
Type a number
And press the Enter key after typing the number
To use other function enter 0 (Zero) ? 1

Totals 1
Type a number
And press the Enter key after typing the number
To use other function enter 0 (Zero) ? 4

Totals 5
Type a number
And press the Enter key after typing the number
To use other function enter 0 (Zero) ? 4

Totals 9
Type a number
And press the Enter key after typing the number
To use other function enter 0 (Zero) ? 10

Totals 19
Type a number
And press the Enter key after typing the number
To use other function enter 0 (Zero) ? 0

1 = + , 2 = - , 3 = x , 4 = /
Type: 1, 2, 3 OR 4
Type one of the 4 functions and then press Enter ? 2

Substraction

READY.

------------

Well now I seem to have 2 of the calculator's routines working, the addition and the substraction, this is hard for me as I am just learning or relearning how to do such things, use the Commodore interpreter and give them a try and see if you can follow the "Execution" logic, I even added some "Safe Guards" for "Fool Proofing", but only up to a reason able point:

While some others can do much better, this is not bad for somebody kind of new at this, like me, I know some people can do a lot worse than this, maybe some other time I will try to add the multiplication and the division routines, one of them at a time, it is hard for me to make such things.

So far it looks as if addition and substraction are working O.K.

1 REM Front or Top Routine
2 PRINT "This is the front end of a very simple unfinished calculator"
4 PRINT "1 = + , 2 = - , 3 = x , 4 = /"
6 PRINT "Type: 1, 2, 3 OR 4"
8 INPUT "Type one of the 4 functions and then press Enter ";X
30 IF X = 1 THEN 50
31 IF X = 2 THEN 60
32 IF X = 3 THEN 70
33 IF X = 4 THEN 80
34 IF X < 1 THEN 40
35 IF X > 4 THEN 40
36 REM
40 PRINT "Wrong Number, Try again": GOTO 4
45 REM
50 PRINT "Addition": GOTO 100
55 REM
60 PRINT "Substraction": GOTO 200
65 REM
70 PRINT "Multiplication is unsupported for now" : GOTO 2
75 END
80 PRINT "Division is unsupported for now" : GOTO 2
85 END
90 REM Calculator Addition Routine
100 PRINT "Right now you have": PRINT C
101 PRINT "Type a number"
102 PRINT "And press the Enter key after typing the number"
104 INPUT "To use other function enter 0 (Zero) "; A
106 IF A = 0 THEN 4
108 A = A + C
112 C = A
114 GOTO 100
115 REM
200 REM Substraction Routine
201 PRINT "Right now you have": PRINT C
202 PRINT "Type a number"
203 PRINT "And press the Enter key after typing the number"
204 INPUT "To use other function enter 0 (Zero) "; A
206 IF A = 0 THEN 4
207 IF C > A THEN 210
208 IF C < A THEN 213
210 C = C - A
211 GOTO 201
212 END
213 PRINT "Can't substract from a lower number"
214 GOTO 201
215 END


Entry #337

9th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

Numbers and strings can also be printed close or near to each other.

The Semicolon ; is used between data.

1 PRINT 1;2;3;7;23;19;874


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
1 PRINT 1;2;3;7;23;19;874
RUN
    1  2  3  7  23  19  874

READY.

--------

The computer prints 2 spaces between the numbers.

-------

To print 2 Strings:

10 PRINT "HOT";"DOG"

---


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT "HOT";"DOG"
RUN
HOTDOG

READY.

In that way no spaces were printed between HOT and DOG.

-----------

10 PRINT " HOT ";"DOG"

-------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT " HOT ";"DOG"
RUN
    HOT DOG

READY.

-------------------

To print 4 numeric variables:

10 W=10:X=15:Y=20:Z=25

20 PRINT W;X;Y;Z

---------------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 W=10:X=15:Y=20:Z=25

20 PRINT W;X;Y;Z
RUN
    10  15  20  25

READY.

-----------------------

To PRINT 3 String Variables:

10 A$="TICK":B$="TOCK":C$=" "

20 PRINT A$;C$;B$

TheC$" " is also a string.

Numbers and strings can also be mixed.

----------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 A$="TICK":B$="TOCK":C$=" "

20 PRINT A$;C$;B$
RUN
TICK TOCK

READY.

------------------

10 X=2*3

20 PRINT "THE ANSWER=";X

-------------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 X=2*3

20 PRINT "THE ANSWER=";X
RUN
THE ANSWER= 6

READY.

--------------

10 PRINT 10;20;30;40

20 PRINT 100;200;300;400

30 PRINT 1000;2000;3000;4000

-------------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT 10;20;30;40

20 PRINT 100;200;300;400

30 PRINT 1000;2000;3000;4000
RUN
    10  20  30  40
    100  200  300  400
    1000  2000  3000  4000

READY.
In this way data doesn't line up right as when you use standard columns.
---------------------

--------------------

To print data with spaces you can use the SPC keyword.

SPC(X) the (X) stand for the number of spaces.

For example:

10 PRINT "A" SPC(6) "B"

It should skip 6 spaces between A and B.

--------------------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT "A" SPC(6) "B"
RUN
A      B

READY.

------------------

Variables can be used to represent the spaces:

10 S1=7

20 S2=11

30 PRINT "A" SPC(S1) "B" SPC(S2) "C"

-------------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 S1=7

20 S2=11

30 PRINT "A" SPC(S1) "B" SPC(S2) "C"
RUN
A       B           C

READY.

--------------

The TAB keyword.

TAB(X), X = 0 up to 255

----------

10 PRINT TAB(20) "ABC" TAB(30) "DEF"

----------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 PRINT TAB(20) "ABC" TAB(30) "DEF"
RUN
                       ABC                              DEF

READY.

-----------------

Numeric variables can also be used:

10 A1=20

11 A2=30

12 PRINT TAB(A1) 200 TAB(A2) "BANANAS"

-------------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
10 A1=20

11 A2=30

12 PRINT TAB(A1) 200 TAB(A2) "BANANAS"
RUN
                        200                               BANANAS

READY.

--------------------------

Printing reverse characters is just printing with reverse colors, the font and the background of the characters will be reversed that is their colors only.

That is for an emulator or for a Comodore 64, so I will skip on that here at least for now.

-----------------

On a Commodore there are cursor control keys CRSR and they can also be used with the PRINT command, but here on a Pc like this that casn't be done other than with an emulator so I have to skip on that.

------------------

On an emulator and on the C-64 there are other ways in which the key words can be entered like using ? for the PRINT keyword, let us see if that will work here with this interpreter or not:

1 ? "Hello"

-------


       **** COMMODORE 64 BASIC V2 ****

    64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
1 ? "Hello"
RUN
Hello

READY.
--------

It worked so that can be used.

I think that all the keywords have such things, for more info look at the books that you downloaded from my links on the C-64 guides maybe at the very end of them they are there.

Such things do save on having to do a lot of typing, long ago when I took a look at Commodore basic and was typing a lot of programs' lines by hand I was using them.

--------------

So here ? = PRINT

==============

Well that is it for this post.

-----------------

Are we learning some yet?

Programming is so hard and complicated and takes so very long to code and to think how to code in order to do what you want done and it might take a lot of Math knowledge to do things that might be of some use, that it might not be a thing that many or most of us want or should do.

And not because a person knows what the keywords do, that doesn't mean that a person can make programs with them, things are complicated and convoluted.

As Andrew said about WinHunter (His Lottery Program): "Not For The Faint Of Heart".

Entry #336

8th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

Well, by now we have already seen some of the PRINT keyword.

Data can be PRINTed into standard columns, there being in the screen 4 such of them, at the very least on a Commodore 64.

Data items can be printed near each other.

Data can be printed a given number of spaces apart, you tell the computer how many spaces apart to print them.

You can also print data at TAB settings.

On the Commodore you can also print reversed characters their colors will be reversed.

In Commodore BASIC you can also print cursor movements so that the program is able to move the curson to particular point on the screen before you PRINT.

With the PRINT command you can also Clear the screen.

On a Commodore 64 to clear the screen you hold down the Shift and then press  the CLR/Home key, the same kind be done in a program with line numbers:

10 PRINT "SHIFT CLR/HOME"

If there was something on the screen from before, it would be cleared after doing this.

----------------
There are some Commodore characters that can't be printed on a Windows Pc unless a Commodore emulator or something like it is used.
------------------

There are many Commodore characters that can be PRINTed using the PRINT keyword, but not on a Windows Pc, unless a special program like an emulator is used.

That makes it very hard or impossible to show a lot of Commodore programming, in a regular way or maybe in any way.

----------------------
To show how to print on standard columns try this:

10 PRINT "SHIFT CLR/HOME"
20 PRINT 5,6,7,8
30 PRINT 1,7,6,4
40 PRINT 4,3,1,20

I guess that I will now try that on the DOS interpreter, but only lines 20 to 40 as the Pc's keyboard and the interpreter can't handle line # 10.

This is what I got:

    **** COMMODORE 64 BASIC V2 ****

 64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.
20 PRINT 5,6,7,8
30 PRINT 1,7,6,4
40 PRINT 4,3,1,20
RUN
 5            6            7            8
 1            7            6            4
 4            3            1            20

READY.
------------------
Very nice, it worked O.K.
I already showed you how to copy and paste to and also from on a DOS box, Do you remember how?
If you don't remember go back to the beginning of this new thread here on BASIC programming and reread 'till you find the info there, it is very easy to do and saves a lot of time.
---------------

A Commodore 64 can print up to 40 character on each line so the 40 characters are divided into the 4 standard PRINT columns.

Each column is 10 charcters long.

Column 1 starts at position 1
Column 2 Starts at position 11
Column 3 starts at position 21
Column 4 starts at position 31

As seen from before use PRINT and put a comma between the data that you want printed.

Try:
PRINT 1
-------
PRINT 1,2
----------
PRINT 1,2,3
-----------
PRINT 1,2,3,4
--------
You can use any kind of data I guess such as

PRINT "HOUSE"
------
PRINT "HOUSE","CAR"
--------
Etc.
------------
To PRINT values of Numeric Variable you might try this:

10 W=10:X=15:Y=20:Z=25
20 PRINT W,X,Y,Z
-----------
For String Variables:

10 A$="HAT":B$="COAT":c$="GLOVES"
20 PRINT A$,B$,C$
----------
Numeric and string variables can be mixed:

10 N=5:A$="GIRLS"
20 PRINT "THERE ARE",N,A$
-------
If you try to print more than 4 columns the rest will show-up on the next line, try to print more than 4 and you will see.
-----
Take your time and try to RUN all the examples given, it is easier to learn in that way.
---------------
The longest single number that you can print in a standard columns is 7 digits such as 1234567.
-------
The longest single string that can be printed on a column is 9 characters long such as ABCDEFGHI.
-----------
This is a long lesson the rest will be posted little by little in parts.
------------

Entry #335

7th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

The CLR keyword

It clears out variables that have been defined.

Undimensions any arrays.

And restores the data pointer back to the beginning

The same thing is done by the use of the:

RUN, LOAD and the NEW commands.

----------

It is not the same as the CLR-Home Key which clears the screen.

-------

An example:

20 C = 90

25 CLR

30  PRINT C

RUN

0

It printed 0 because CLR cleared C from 90 down to 0.

----------------

LET as said before is an optional command as it was said before.

BASIC remembers the values that have been assigned to variables using the LET keyword command.

But as said those values are deleted when one of these is or are used:

CLR or CLEAR

RUN

NEW

-------

Also if a variable is used before it is given a value its value will be Zero-0

Like type on the BASIC interpreter:

PRINT A

0

It is the same as:

10 PRINT A

RUN (Or RUN 10)

0

----------

Next I will show the INPUT, the IF-THEN and the GOTO statements:

5 PRINT "Enter a number"

10 INPUT B

20 IF B = 0 THEN 50

30 PRINT "Non Zero"

40 GOTO 5

50 PRINT "Zero"

60 GOTO 5

It is in a non-ending loop, it doesn't END.

The original program didn't have line 5 on it, I added that to it, otherwise a person would not know what the program wanted as an INPUT as it would just PRINT and show a ?

Many or most of these simple programs should run on many old BASIC interpreters.

----------------------

=  Equal to

> Greater than

< Less than

<> Not equal to

<= Less than or equal to

=> Greater than or equal to

----------------

5 PRINT "INPUT numbers then press Enter-Return"

10 INPUT A

15 INPUT B

20 IF A<=B THEN 50

30 PRINT "A is bigger"

40 GOTO 5

50 IF A<B THEN 80

60 PRINT "They are the same"

70 GOTO 5

80 PRINT "B is bigger"

90 GOTO 5

Beware of possible mistakes.

Try to follow the logic of how the program executes the commands on the lines, programming is all about Logic.

RUN the programs a few times and play with them.

I added line # 5 as it was not on the original program.

------------

Back to variables

We can assign:

An Integer number or:

A Floating Point Number or:

A Text String to a Variable.

The % symbol following a Variable indicates that the variable represents an integer number:

A%

X%

AL%

AM%

-------

THe $ Following the Variable tell that the variable represents a Text String:

A$

X$

ML$

-----

Floating point variables follow the same format, I don't quite understand that about floating point variables, but later I will try to read on that when I am ready to.

----------

Very important:

First of all these all is basic stuff and might be of help for learning any basic language old or new

Next:

A variable name can have one or two characters as basic looks at the first 2 characters on a variable, those are the ones that matter.

The very first character must be a letter any-one  of them from A to Z.

The second character can be any-one character either a single letter from A to Z or any single digit from 0 to 9, one or the other.

The third character will be either a % or a $, to indicate either an Integer or a text string.

You can use more than 3 character, but besides the % and the $, basic will only look at the very first two characters:

So AL% and ALFRED% will be exactly the same to the computer or to the basic interpreter.

The last rule is that Variables can't contain or have in them any BASIC reserved keywords such as: GOTO, RUN, Etc.

So as I said before a person should get familiar with the BASIC keywords that the BASIC that he is using has on it.

I go very slow and also repeat stuff, so this is all for this post, because most of us also have other things to do than to make and or read my posts and I want to make sure that both myself and you more or less understand what I am posting about, after all many like myself might be new or almost completely new to BASIC programming, or we might have forgotten most of what little we knew about old BASIC long ago.

Better read the 2 books that I posted for download time ago on this new thread.

Well more later, now the very basic stuff first and the Commodore 64 Basic Stuff first as there might be more information about C 64 programming than there is for other basics and they might be all kind of similar to each other anyway and this stuff might be nice to learn before trying to learn how to program with newer BASICS.

Besides many of the C 64 emulators are free and there are also old DOS BASIC interpreters that are kind of free.

Did you not already download some of them?

And there are even maybe a few more, but more on that later.

Entry #334

New Commodore 64 will run Commodore, Linux and Windows software.

It is or will be sold by Barry Altman of Commodore USA, LLC.

Use Google if you want to find the Internet site.

I myself if I was a prospective buyer might not send them any money maybe to preorder their new Commodore 64, as they might not be ready to send  them yet, also their Commodore and or Windows software might also not be ready yet on their Pc nor might they be ready to send it on CD yet, I am not sure so look at their web page yourself.

I just now found out about this, by looking at other stuff on the net, using Google.

I would have thought that besides making something like this that they might also make some sort of more or less retro compatible but also enhanced Windows compatible software that is a language similar to the old C -64 language but with new windows kind of sound and graphics commands as similar as possible to those used on the old C 64 and that can compile programs to .Exe files and run on any Windows Pc without any runtimes, it should be able to make more complex sounds and graphics as other newer programming languages can do.

Well if all that is needed is to run or program using Commodore basic then emulators already can do that, but their C 64 windows are kind of small or at least they were before and this new Pc I guess that can give a much bigger monitor full image.

The downside might be that for running Pc programs it might not be the best as it might not be as fast as most regular desktops are, it might be more like a much slower laptop portable Pc.

Again I say that I don't have anything to do with them.

I also don't think that using the old C 64 computer case is such a good thing, I sure don't like that old box, it is ugly as hell.

They should instead have used the case in which the newer C 64s came in, I think that they were the C 64 C or whatever.

Entry #333

Commodore 64 Emulators

Using a search engine such as Google look for any-one of these or all of them one at a time:

Commodore 64 Emulators

Commodore Emulators

C 64 Emulators

C-64 Emulators

C - 64 Emulators

Entry #332

6th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

Commodore basic is not exactly the same as that of all other old and new basics, so beware of problems if you try these with other basic interpreters, emulators, languages or programs.

COMMODORE 64 PROGRAMMER'S REFERENCE GUIDE

Strings or     string constants

Pages 4 >

Letters = "JOE"

Numbers = "860"

Symbols = "$^*"

Or a mix of any of those such as: "6K)"

Strings are inside quotes "X"

------------

Data can be numbers 48923 or strings "/?9F"

-----------

Numeric Variables

Represent numbers

2 LEM = 25

4 PRINT LEM

Type RUN

Type Enter-Return

Get

25

-----

LEM = Numeric Variable

25 = Numeric Constant

---------------------------

String Variables

A string variable represents strings

2 FRUIT$ = "BANANA"

4 PRINT FRUIT$

RUN

BANANA

-------------------

FRUIT$ = String Variable

"BANANA" = String Constant

----------------------

Names must start with a letter

String variables must end with $

Different variables must not have the same 2 characters

You may not use variables that have in them basic commands

So we must get familiar first with the names of basic commands.

--------

It is also ok:

DOK = 6+4

-----


2 Y=96

4 AGE=Y

6 PRINT AGE

RUN

96

------------

NAME$ = "JOE"

-----

2 D$ = "JOE"

4 C$ = D$

------------

Beware of mistakes verify info yourself

----------------

LET DOG = 3

LET TH$ = "MAY"

In that case the LET command is optional it doesn't have to be used it can just be:

DOG = 3

TH$ = "MAY"

-----

Type in direct mode or with numbers if in a program:

X = 250 + 50

PRINT X

-----------

5 X = 250 - 50

10 PRINT X

------------

To multiply use *

Y = 3*2

PRINT Y

------------

To divide

J = 100/4

PRINT J

----------------

Exponents or Powers:

2^2 = 4

9^2 = 81

2^3= 8

Beware of mistakes

1 LE = 3^3

2 PRINT LE

--------

2 Y = [2^3] - 5

4 PRINT Y

--------------

Order of Math operations it is best to put the operations in parentheses otherwise:

Powers-Exponents are done first, then:

Multiplications and divisions are second, then:

Additions and substractions are last.

Read the C-64's Guide.

Using parenthesis you can do like this:

C = ((2^3)+15)*6

Maybe much better than trying to guess how it will be computed by the program or the Pc.

------------

PRINT "MOTOR" + "CAR"

MOTORCAR

-----------

PRINT "MOTOR" + " " + "CAR"

MOTOR CAR

--------------

10 X$ = "JOE"

15 K$ = " "

20 Y$ = "BROWN"

30 PRINT X$ + K$ + Y$

RUN

JOE BROWN

------------

No more of these posts for a few days (1 to 3 or so ) then I will continue them.

You might want to try the examples with the C-64 Interpreter or with a C-64 Emulator or with some other old basic interpreter and make sure that there are no mistakes if there are mistakes make sure that a C-64 interpreter or emulator is used and also read the C-64 guides that you might have downloaded or some other basic tutorial(s) or guide(s).

---------------

Beware of  mistakes, so read basic guides or tutorials, other than what I post on here.

Entry #331

5th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.


                                 Commodore BASIC Character Set               
 
                  BLANK - separates keywords and variable names       
          ;       SEMI-COLON - used in variable lists to format output
          =       EQUAL SIGN - value assignment and relationship testing
          +       PLUS SIGN - arithmetic addition or string concatenation
                             (concatenation: linking together in a chain)
          -       MINUS SIGN - arithmetic subtraction, unary minus     
          *       ASTERISK - arithmetic multiplication                 
          /       SLASH - arithmetic division                         
          ^       UP ARROW - arithmetic exponentiation                 
          (       LEFT PARENTHESIS - expression evaluation and functions
          )       RIGHT PARENTHESIS - expression evaluation and functions
          %       PERCENT - declares variable name as an integer       
          #       NUMBER - comes before logical file number in input/ 
                           output statements                           
          $       DOLLAR SIGN - declares variable name as a string     
          ,       COMMA - used in variable lists to format output; also
                          separates command parameters                 
          .       PERIOD - decimal point in floating point constants   
          "       QUOTATION MARK - encloses string constants           
          :       COLON - separates multiple BASIC statements in a line
          ?       QUESTION MARK - abbreviation for the keyword PRINT   
          <       LESS THAN - used in relationship tests               
          >       GREATER THAN - used in relationship tests           
         {pi}     PI - the numeric constant 3.141592654

-------------------------------------------------------------------------------

Always type NEW and hit <RETURN-ENTER> before starting a new program.

-------------------------------------------------------------------------------

A person should really read the:

COMMODORE 64 PROGRAMMER'S REFERENCE GUIDE

http://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference.htm

http://www.commodore.ca/manuals/c64_users_guide/c64-users_guide.htm

http://project64.c64.org/hw/c64.html

Anyhow read:

Hierarchy of Operations .....................................   15

And 10 to 17 pages

---------------------------------------------------------------------------

Read about the PRINT  and the PRINT# keywords on pages 70 to 76

--------------------

EXPONENTIATION
Use the up arrow (^) to raise a number to a power.  Press the  <RETURN>
key after you type the calculation.  For example, to find 12 to the fifth
power, type this:
PRINT 12^5                      Key in this and <RETURN>

    248832                          The computer displays this

This is the same as:

PRINT 12*12*12*12*12

    248832

--------------------

3.3. MULTIPLE CALCULATIONS ON ONE LINE

The  last  example shows that you can perform more than one calculation

on  a  line.  You can also perform different kinds of calculations on the

same line. For example:

PRINT 3 * 5 - 7 + 2                 Key in this and <RETURN>

10                              The computer displays this

So  far  our  examples have used small numbers and simple problems. But

the 64 can do much more complex calculations. The next example adds large

numbers.

Notice that 78956.87 doesn't have a comma between the 8 and the 9.  You

can't  use  commas  this  way in BASIC.  BASIC thinks commas indicate new

numbers,  so it would think  78,956.87  is two numbers:  78  and  956.87.

Remember to press <RETURN> after you type the problem.

PRINT 1234.5 + 3457.8 + 78956.87

83649.17

The next example uses a ten digit number.  The 64 can work with numbers

that  have  up  to  ten  digits,  but can only display nine digits in the

answer.  So the 64 rounds numbers that are more than nine digits. Numbers

five  and  over  are  rounded up,  and numbers four and under are rounded

down.  This  means that 12123123.45 is rounded to 12123123.5.  Because of

rounding,  the  computer  doesn't  give  the same answer you'd get if you

added  these  numbers by hand.  In this case, the answer is 12131364.817.

You can see the difference rounding makes.

PRINT 12123123.45 + 345.78 + 7895.687

12131364.9

The  64  prints numbers between  0.01  and  999,999,999  using standard

notation, except for leaving out commas in large numbers. Numbers outside

this  range  are  printed using scientific notation.  Scientific notation

lets you express a very large or very small number as a power of 10.  For

example:

PRINT 123000000000000000

1.23E+17

Another way of expressing this number is  1.23 * 10 ^ 17.  The  64 uses

scientific  notation  for numbers with lots of digits to make them easier

to read.

There  is  a  limit to the numbers the computer can handle,  even using

scientific notation. These limits are:

Largest numbers : +/- 1.70141183E+38

Smallest numbers: +/- 2.93873588E-39

3.4. EXECUTION ORDER IN CALCULATIONS

If you tried to perform some mixed calculations of your own,  you might

not  have  gotten the results you expected.  This is because the computer

performs calculations in a certain order.

In this calculation:

20 + 8 / 2

the answer is 14 if you add 20 to 8 first,  and  then divide 28 by 4. But

the answer is 24 if you first divide 8 by 2, and then add 20 and 4.

On  the  64,  you  always  get  24 because the computer always performs

calculations  in the same order.  Problems are solved from left to right,

but  within  that  general  movement,  some  types  of  calculations take

precedence over others. Here is the order of precedence:

First :   -     minus sign for negative numbers, not for subtraction.

Second:   ^     exponentiation, left to right

Third :   * /   multiplication and division, left to right

Fourth:   + -   addition and subtraction, left to right

This  means that the computer checks the whole calculation for negative

numbers before doing anything else.  Then it looks for exponents; then it

performs all multiplication and division; then it adds and subtracts.

This explains why  20 + 8 / 2  is  24:  8 is divided by 2  before 20 is

added because division has precedence over addition.

There  is an easy way to override the order of precedence:  enclose any

calculation you want solved first in parentheses.  If you add parentheses

to the equation shown above, here's what happens:

PRINT (20 + 8) / 2

14

You  get  14  because the parentheses allow 20 and 8 to be added before

the division occurs.

Here's another example that shows how you can change the order, and the

answer, with parentheses:

PRINT 30 + 15 * 2 - 3

57

PRINT (30 + 15) * 2 - 3

87

PRINT 30 + 15 * (2 - 3)

15

PRINT (30 + 15) * (2 - 3)

-45

The last example has two calculations in parentheses. As usual, they're

evaluated from left to right, and then the rest of the problem is solved.

When  you have more than one calculation in parentheses,  you can further

control the order by using parentheses within parentheses. The problem in

the innermost parentheses is solved first. For example:

PRINT 30 + (15 * (2 - 3))

15

    In this case,  3 is subtracted from 2, then 15 is multiplied by -1, and

-15  is added to 30.  As you experiment with solving calculations, you'll

get familiar with the order in which mixed calculations are solved.

3.5. COMBINING PRINT'S CAPABILITIES

The 64 computers let you combine the two types of print statements that

you've  read  about  in this book.  Remember that anything you enclose in

quotation marks is displayed exactly as you type it.

The  next  example  shows  how  you  can  combine  the  types  of PRINT

statements.  The  equation  enclosed in quotes is displayed without being

solved. The equation not in quotes is solved. The semicolon separates the

two parts of the PRINT statement (semicolon means no space).

PRINT "5 * 9 ="; 5 * 9              You key in this and <RETURN>

5 * 9 = 45                      The computer displays this

Remember,  only  the  second  part of the statement actually solves the

calculation.  The two parts are separated by a semicolon. You always have

to  separate  the  parts of a mixed PRINT statement with some punctuation

for  it  to work the way you want it to.  If you use a comma instead of a

semicolon,  there  is  more  space  between  the  two  parts when they're

displayed. A semicolon leaves out space.

The 64's screen is organized into 4 zones of 10 columns each.  When you

use a comma to separate parts of a PRINT statement,  the comma works as a

tab, sending each result into the next zone. For example:

PRINT "TOTAL:";95,"SHORTAGE:";15

TOTAL: 95           SHORTAGE: 15

If you have more than four results, they are automatically displayed on

the next line. For example:

PRINT 2 * 3,4 - 6,2 ^ 3,6 / 4,100 + (-48)

6        -2         8         1.5

52

Here's the difference when you use semicolons:

PRINT 2 * 3;4 - 6;2 ^ 3;6 / 4;100 + (-48)

6 -2  8  1.5  52

You  can  use  the  difference  between  the comma and the semicolon in

formatting PRINT statements to create complex displays.

--------------------------------------------------

So next the END KEYWORD

NEW

10 REM How to use the END keyword command

12 PRINT "RED","BROWN","GREEN"

14 END

-----

Copy that and then paste onto the C64 program and then type RUN and hit ENTER

Get:

RED          BROWN          GREEN

READY.

------------

Also it can work like this:

10 REM How to use the END keyword

12 PRINT"RED":PRINT"BROWN":PRINT"GREEN":END

Copy that and then paste onto the program and then type RUN and hit Enter and the get:

RED

BROWN

GREEN

READY.

-------------

All of that also works on DIRECT Mode, without line numbers.

----------------------------------

Well you already know about the LIST keyword, it will LIST a program loaded into memory into the C64 Interpreter.

----------------------------

If you already have a program listing into the program's memory and want to delete a line for example:

Line 10

10 REM How to use the END keyword command

12 PRINT "RED","BROWN","GREEN"

14 END

Type line 10 without anything on it like this:

10

Then hit the Enter key.

Now list the program's lines:

LIST

And you will see that line 10 is now gone:

12 PRINT "RED","BROWN","GREEN"

14 END

--------------

To change a line for example line 12 type it again:

12 PRINT "RED","BROWN"

14 END

Now if you RUN it you will get:

RED          BROWN

READY.

---------------------

Well that is all for today.

Entry #330

4th Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

The maker of "cbmbasic-1.0-win32" says that it is 100% compatible with the Commodore 64, but as it is by itself, it doesn't seem to be, no peeks nor pokes, nor graphics, nor colors, Etc.

Anyhow it works on a DOS window, you can type program lines on the screen and or you can paste the text of the program's lines onto the DOS window, put the cursor on the very top of the window and Rth Click on the Mouse, then goto Edit and then to Paste and in this way you can first copy programs listings and then paste them onto the "cbmbasic-1.0-win32" DOS window and then either RUN them LIST them or SAVE them:

RUN

LIST

SAVE "NAME OF PROGRAM"

And once a program is saved into the same folder as the program is, you can then later at any-time LOAD it into the program:

LOAD "NAME OF PROGRAM"

Once a program is loaded it can be:

RUN(NED)

Or

LIST(ED)

-------

Remember for the program to work ok, limited as it is by itself, the "Caps Lock" must always be on.

-------------------------------

There is "Direct Mode" Such as entering commands onto the DOS window without line numbers:

PRINT 4+6

Then press the return key and get:

10

-------

Also:

PRINT "HELLO"

Press Return and get:

HELLO.

----------

Program Mode is when you use Line Numbers and the program is not executed until you first enter RUN and then press the Enter key,  the Enter key works as the RETURN Key.

Such as:

10 PRINT 4+9

RUN

13

Or

10 PRINT "CAR"

RUN

CAR

--------------

This has also shown  some the basic keyword command PRINT.

------------------

So program lines begin with numbers, it seems as if you can even start with line # 0 at least with this particular Basic Interpreter.

0 PRINT "WHATEVER"

RUN

WHATEVER

----------

A KeyWord or Command gives instructions to the computer, that is, it tells the computer what to do.

Each Basic Interpreter program has a list of words that is used for giving the computer instructions.

-----------

The KeyWord or Command REM is or means REMARK, it is used for putting remarks or notes on the program, that is all that it does, that is, it doesn't do much of anything at all.

For Example:

1 REM How to Substract numbers

2 PRINT 55-25

RUN

30

-----------

By the way to:

Add use +

Substract use -

Multiply use *, if you try to use X, you will see that it doesn't work, at least not with this Commodore 64 interpreter.

Divide use /

-----------------------

That is all on this for today, I am also more or less learning or on some things relearning as I type these things.

Since I can't seem to make this fully work as a regular C-64 then we are so far limited to only using a portion of the full set of basic commands.

If we were talking about a Commodore 64 emulator then we could use all or at least most of the C-64 keywords commands-instructions.

I might talk some about Commodore emulators later, maybe or maybe not.

Anyhow, some more about the Commodore basic commands later as I can make time for.

The set of Commodore basic commands is more or less about the same as those of some old basic interpreters, that is the basic-basic keywords, some keywords are more or less the same, but each interpreter has its own set of commands, only some of the commands might be shared among many or most of the old basic interpreters.

----------

Now this is really all for Today.

Entry #329

3rd Part: "Nostalgia" "Old" Basic Language interpreters, Commodore 64 Basic Interpreter # 1.

http://download.polytechnic.edu.na/pub4/download.sourceforge.net/pub/sourceforge/c/project/cb/cbmbasic/cbmbasic/1.0/

http://download.polytechnic.edu.na/pub4/download.sourceforge.net/pub/sourceforge/c/project/cb/cbmbasic/cbmbasic/1.0/cbmbasic-1.0-win32.zip

When using this Commodore 64 Basic Interpreter you need to turn "Caps Lock" ON otherwise it will not work, it will just give you:

Syntax Errors.

-------

Type inside the DOS box:

10 DIM N$(20)

20 PRINT "WHAT IS YOUR NAME";
30 INPUT N$
40 PRINT "HELLO, "; N$; "!"
50 END

Then type:
run
then press the "Enter" key.
---------------

    10 PRINT"YOUR NAME": INPUT N$
    20 PRINT"HELLO",N$
---------------
10 PRINT"ENTER A NUMBER": INPUT A
    20 PRINT A
----------------

    10 PRINT"ENTER A WORD": INPUT A$
    20 PRINT A$
------------

    10 PRINT"ENTER A NUMBER": INPUT A
    20 PRINT A "TIMES 5 EQUALS" A*5
------------
10 PRINT"TYPE 2 NUMBERS": INPUT A: INPUT B
------------
  BEFORE CRUNCHING:              AFTER CRUNCHING:

  10 PRINT"HELLO...";            10 PRINT "HELLO...";:FORT=1TO500:NEXT:
  20 FOR T=1 TO 500: NEXT           PRINT"HELLO, AGAIN...":GOTO10
  30 PRINT"HELLO, AGAIN..."
  40 GOTO 10
-----------
As this program is not the real hardware C-64 machine but only a software on a Pc machine it can't run all the C-64 programs.
I guess that for example the Peek and Poke keyword commands don't work and the same will be true for some other
commands that might work on an emulator, but not on this here interpreter.
------------------
100 FOR L = 1 TO 100
    110 IF RND(1) < .5 THEN X=X+1: GOTO 130
    120 Y=Y+1
    130 NEXT L
    140 PRINT "HEADS=" X
    150 PRINT "TAILS= " Y
------------------
Color commands might not work either on this C-64 basic Interpreter so it is not really 100% compatible with the real thing.
------------
Sound Commands would not work either I guess.
-----------
10 FOR B=99 TO 1 STEP -1
20 GOSUB 100
30 T$=T$+" OF BEER ON THE WALL"
40 PRINT T$;", ";T$
50 PRINT "TAKE ONE DOWN AND PASS IT AROUND, "
60 IF B-1<=0 THEN PRINT "NO MORE BOTTLES OF BEER ON THE WALL":GOTO 80
70 GOSUB 200:PRINT " OF BEER ON THE WALL"
80 PRINT:NEXT
91 PRINT "GO TO THE STORE AND BUY SOME MORE, 99 BOTTLES OF BEER ON THE WALL"
92 END
100 T$=STR$(B)+" BOTTLE":IF B>1 THEN T$=T$+"S"
110 RETURN
200 A=B-1:PRINT STR$(A)+" BOTTLE";
210 IF A>1 THEN PRINT "S";
220 RETURN
----------
http://ebookbrowse.com/c64-programmers-reference-guide-02-basic-language-vocabulary-pdf-d47081109
Entry #328

2nd Part: "Nostalgia" "Old" Basic Language interpreters, Bywater and GWBasic Interpreters.

http://www.programmersheaven.com/download/15918/ZipFileList.aspx

http://web.cs.mun.ca/~ed/cs2602/basic2.html

http://web.cs.mun.ca/~ed/cs2602/basic1.html

------------------

With it you can type and run the programs on-inside the DOS window, read the documents also

Type inside the DOS window as a short sample:

2 print "Hello World"

then press enter and then type:

run

and then press enter again and you will see:

Hello World.

This is for learning how to use the basic statements of "Old" Basic, the lines need numbers I guess.

But you might also be able to run programs in "Real time" as you type the program, without the numbers.

--------------------

http://www.oocities.org/KindlyRat/GWBASIC.html

http://www.oocities.org/KindlyRat/GWBASIC.EXE.zip

Copy then paste to notepad then save as:

poker.bas

Then open GWBasic Interpreter

Then load into GWBasic interpreter:

Type inside the DOS window:

load "poker.bas"

Then type "Enter"

then type:

run

Then press Enter

 

2 PRINT TAB(33);"POKER"
4 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
6 PRINT: PRINT: PRINT
10 DIM A(50),B(15)
20 DEF FNA(X)=INT(10*RND(1))
30 DEF FNB(X)=X-100*INT(X/100)
40 PRINT "WELCOME TO THE CASINO.  WE EACH HAVE $200."
50 PRINT "I WILL OPEN THE BETTING BEFORE THE DRAW; YOU OPEN AFTER."
60 PRINT "TO FOLD BET 0; TO CHECK BET .5."
70 PRINT "ENOUGH TALK -- LET'S GET DOWN TO BUSINESS."
80 PRINT
90 LET O=1
100 LET C=200
110 LET S=200
120 LET P=0
130 REM
140 PRINT
150 IF C<=5 THEN 3670
160 PRINT "THE ANTE IS $5.  I WILL DEAL:"
170 PRINT
180 IF S>5 THEN 200
190 GOSUB 3830
200 LET P=P+10
210 LET S=S-5
220 LET C=C-5
230 FOR Z=1 TO 10
240 GOSUB 1740
250 NEXT Z
260 PRINT "YOUR HAND:"
270 N=1
280 GOSUB 1850
290 N=6
300 I=2
310 GOSUB 2170
320 PRINT
330 IF I<>6 THEN 470
340 IF FNA(0)<=7 THEN 370
350 LET X=11100
360 GOTO 420
370 IF FNA(0)<=7 THEN 400
380 LET X=11110
390 GOTO 420
400 IF FNA(0)>=1 THEN 450
410 X=11111
420 I=7
430 Z=23
440 GOTO 580
450 Z=1
460 GOTO 510
470 IF U>=13 THEN 540
480 IF FNA(0)>=2 THEN 500
490 GOTO 420
500 Z=0
510 K=0
520 PRINT "I CHECK."
530 GOTO 620
540 IF U<=16 THEN 570
550 Z=2
560 IF FNA(0)>=1 THEN 580
570 Z=35
580 V=Z+FNA(0)
590 GOSUB 3480
600 PRINT "I'LL OPEN WITH $"V
610 K=V
620 GOSUB 3050
630 GOSUB 650
640 GOTO 820
650 IF I<>3 THEN 760
660 PRINT
670 PRINT "I WIN."
680 C=C+P
690 PRINT "NOW I HAVE $"C"AND YOU HAVE $"S
700 PRINT "DO YOU WISH TO CONTINUE";
710 INPUT H$
720 IF H$="YES" THEN 120
730 IF H$="NO" THEN 4100
740 PRINT "ANSWER YES OR NO, PLEASE."
750 GOTO 700
760 IF I<>4 THEN 810
770 PRINT
780 PRINT "YOU WIN."
790 S=S+P
800 GOTO 690
810 RETURN
820 PRINT
830 PRINT "NOW WE DRAW -- HOW MANY CARDS DO YOU WANT";
840 INPUT T
850 IF T=0 THEN 980
860 Z=10
870 IF T<4 THEN 900
880 PRINT "YOU CAN'T DRAW MORE THAN THREE CARDS."
890 GOTO 840
900 PRINT "WHAT ARE THEIR NUMBERS:"
910 FOR Q=1 TO T
920 INPUT U
930 GOSUB 1730
940 NEXT Q
950 PRINT "YOUR NEW HAND:"
960 N=1
970 GOSUB 1850
980 Z=10+T
990 FOR U=6 TO 10
1000 IF INT(X/10^(U-6))<>10*INT(X/10^(U-5)) THEN 1020
1010 GOSUB 1730
1020 NEXT U
1030 PRINT
1040 PRINT "I AM TAKING"Z-10-T"CARD";
1050 IF Z=11+T THEN 1090
1060 PRINT "S"
1070 PRINT
1080 GOTO 1100
1090 PRINT
1100 N=6
1110 V=I
1120 I=1
1130 GOSUB 2170
1140 B=U
1150 M=D
1160 IF V<>7 THEN 1190
1170 Z=28
1180 GOTO 1330
1190 IF I<>6 THEN 1220
1200 Z=1
1210 GOTO 1330
1220 IF U>=13 THEN 1270
1230 Z=2
1240 IF FNA(0)<>6 THEN 1260
1250 Z=19
1260 GOTO 1330
1270 IF U>=16 THEN 1320
1280 Z=19
1290 IF FNA(0)<>8 THEN 1310
1300 Z=11
1310 GOTO 1330
1320 Z=2
1330 K=0
1340 GOSUB 3050
1350 IF T<>.5 THEN 1450
1360 IF V=7 THEN 1400
1370 IF I<>6 THEN 1400
1380 PRINT "I'LL CHECK"
1390 GOTO 1460
1400 V=Z+FNA(0)
1410 GOSUB 3480
1420 PRINT "I'LL BET $"V
1430 K=V
1440 GOSUB 3060
1450 GOSUB 650
1460 PRINT
1470 PRINT "NOW WE COMPARE HANDS:"
1480 J$=H$
1490 K$=I$
1500 PRINT "MY HAND:"
1510 N=6
1520 GOSUB 1850
1530 N=1
1540 GOSUB 2170
1550 PRINT
1560 PRINT "YOU HAVE ";
1570 K=D
1580 GOSUB 3690
1590 H$=J$
1600 I$=K$
1610 K=M
1620 PRINT "AND I HAVE ";
1630 GOSUB 3690
1640 IF B>U THEN 670
1650 IF U>B THEN 780
1660 IF H$="A FLUS" THEN 1700
1662 IF FNB(M)<FNB(D) THEN 780
1664 IF FNB(M)>FNB(D) THEN 670
1670 PRINT "THE HAND IS DRAWN."
1680 PRINT "ALL $"P"REMAINS IN THE POT."
1690 GOTO 140
1700 IF FNB(M)>FNB(D) THEN 670
1710 IF FNB(D)>FNB(M) THEN 780
1720 GOTO 1670
1730 Z=Z+1
1740 A(Z)=100*INT(4*RND(1))+INT(100*RND(1))
1750 IF INT(A(Z)/100)>3 THEN 1740
1760 IF A(Z)-100*INT(A(Z)/100)>12 THEN 1740
1765 IF Z=1 THEN 1840
1770 FOR K=1 TO Z-1
1780 IF A(Z)=A(K) THEN 1740
1790 NEXT K
1800 IF Z<=10 THEN 1840
1810 N=A(U)
1820 A(U)=A(Z)
1830 A(Z)=N
1840 RETURN
1850 FOR Z=N TO N+4
1860 PRINT Z"--  ";
1870 GOSUB 1950
1880 PRINT " OF";
1890 GOSUB 2070
1900 IF Z/2<>INT(Z/2) THEN 1920
1910 PRINT
1920 NEXT Z
1930 PRINT
1940 RETURN
1950 K=FNB(A(Z))
1960 IF K<>9 THEN 1980
1970 PRINT "JACK";
1980 IF K<>10 THEN 2000
1990 PRINT "QUEEN";
2000 IF K<>11 THEN 2020
2010 PRINT "KING";
2020 IF K<>12 THEN 2040
2030 PRINT "ACE";
2040 IF K>=9 THEN 2060
2050 PRINT K+2;
2060 RETURN
2070 K=INT(A(Z)/100)
2080 IF K<>0 THEN 2100
2090 PRINT " CLUBS",
2100 IF K<>1 THEN 2120
2110 PRINT " DIAMONDS",
2120 IF K<>2 THEN 2140
2130 PRINT " HEARTS",
2140 IF K<>3 THEN 2160
2150 PRINT " SPADES",
2160 RETURN
2170 U=0
2180 FOR Z=N TO N+4
2190 B(Z)=FNB(A(Z))
2200 IF Z=N+4 THEN 2230
2210 IF INT(A(Z)/100)<>INT(A(Z+1)/100) THEN 2230
2220 U=U+1
2230 NEXT Z
2240 IF U<>4 THEN 2310
2250 X=11111
2260 D=A(N)
2270 H$="A FLUS"
2280 I$="H IN"
2290 U=15
2300 RETURN
2310 FOR Z=N TO N+3
2320 FOR K=Z+1 TO N+4
2330 IF B(Z)<=B(K) THEN 2390
2340 X=A(Z)
2350 A(Z)=A(K)
2360 B(Z)=B(K)
2370 A(K)=X
2380 B(K)=A(K)-100*INT(A(K)/100)
2390 NEXT K
2400 NEXT Z
2410 X=0
2420 FOR Z=N TO N+3
2430 IF B(Z)<>B(Z+1) THEN 2470
2440 X=X+11*10^(Z-N)
2450 D=A(Z)
2460 GOSUB 2760
2470 NEXT Z
2480 IF X<>0 THEN 2620
2490 IF B(N)+3<>B(N+3) THEN 2520
2500 X=1111
2510 U=10
2520 IF B(N+1)+3<>B(N+4) THEN 2620
2530 IF U<>10 THEN 2600
2540 U=14
2550 H$="STRAIG"
2560 I$="HT"
2570 X=11111
2580 D=A(N+4)
2590 RETURN
2600 U=10
2610 X=11110
2620 IF U>=10 THEN 2690
2630 D=A(N+4)
2640 H$="SCHMAL"
2650 I$="TZ, "
2660 U=9
2670 X=11000
2680 GOTO 2740
2690 IF U<>10 THEN 2720
2700 IF I=1 THEN 2740
2710 GOTO 2750
2720 IF U>12 THEN 2750
2730 IF FNB(D)>6 THEN 2750
2740 I=6
2750 RETURN
2760 IF U>=11 THEN 2810
2770 U=11
2780 H$="A PAIR"
2790 I$=" OF "
2800 RETURN
2810 IF U<>11 THEN 2910
2820 IF B(Z)<>B(Z-1) THEN 2870
2830 H$="THREE"
2840 I$=" "
2850 U=13
2860 RETURN
2870 H$="TWO P"
2880 I$="AIR, "
2890 U=12
2900 RETURN
2910 IF U>12 THEN 2960
2920 U=16
2930 H$="FULL H"
2940 I$="OUSE, "
2950 RETURN
2960 IF B(Z)<>B(Z-1) THEN 3010
2970 U=17
2980 H$="FOUR"
2990 I$=" "
3000 RETURN
3010 U=16
3020 H$="FULL H"
3030 I$="OUSE, "
3040 RETURN
3050 G=0
3060 PRINT:PRINT "WHAT IS YOUR BET";
3070 INPUT T
3080 IF T-INT(T)=0 THEN 3140
3090 IF K<>0 THEN 3120
3100 IF G<>0 THEN 3120
3110 IF T=.5 THEN 3410
3120 PRINT "NO SMALL CHANGE, PLEASE."
3130 GOTO 3060
3140 IF S-G-T>=0 THEN 3170
3150 GOSUB 3830
3160 GOTO 3060
3170 IF T<>0 THEN 3200
3180 I=3
3190 GOTO 3380
3200 IF G+T>=K THEN 3230
3210 PRINT "IF YOU CAN'T SEE MY BET, THEN FOLD."
3220 GOTO 3060
3230 G=G+T
3240 IF G=K THEN 3380
3250 IF Z<>1 THEN 3420
3260 IF G>5 THEN 3300
3270 IF Z>=2 THEN 3350
3280 V=5
3290 GOTO 3420
3300 IF Z=1 THEN 3320
3310 IF T<=25 THEN 3350
3320 I=4
3330 PRINT "I FOLD."
3340 RETURN
3350 IF Z=2 THEN 3430
3360 PRINT "I'LL SEE YOU."
3370 K=G
3380 S=S-G
3390 C=C-K
3400 P=P+G+K
3410 RETURN
3420 IF G>3*Z THEN 3350
3430 V=G-K+FNA(0)
3440 GOSUB 3480
3450 PRINT "I'LL SEE YOU, AND RAISE YOU"V
3460 K=G+V
3470 GOTO 3060
3480 IF C-G-V>=0 THEN 3660
3490 IF G<>0 THEN 3520
3500 V=C
3510 RETURN
3520 IF C-G>=0 THEN 3360
3530 IF (O/2)<>INT(O/2) THEN 3600
3540 PRINT "WOULD YOU LIKE TO BUY BACK YOUR WATCH FOR $50";
3550 INPUT J$
3560 IF LEFT$(J$,1)="N" THEN 3600
3570 C=C+50
3580 O=O/2
3590 RETURN
3600 IF O/3<>INT(O/3) THEN 3670
3610 PRINT "WOULD YOU LIKE TO BUY BACK YOUR TIE TACK FOR $50";
3620 INPUT J$
3630 IF LEFT$(J$,1)="N" THEN 3670
3640 C=C+50
3650 O=O/3
3660 RETURN
3670 PRINT "I'M BUSTED.  CONGRATULATIONS!"
3680 STOP
3690 PRINT H$;I$;
3700 IF H$<>"A FLUS" THEN 3750
3710 K=INT(K/100)
3720 GOSUB 2080
3730 PRINT
3740 RETURN
3750 K=FNB(K)
3760 GOSUB 1960
3770 IF H$="SCHMAL" THEN 3790
3780 IF H$<>"STRAIG" THEN 3810
3790 PRINT " HIGH"
3800 RETURN
3810 PRINT "'S"
3820 RETURN
3830 PRINT
3840 PRINT "YOU CAN'T BET WITH WHAT YOU HAVEN'T GOT."
3850 IF O/2=INT(O/2) THEN 3970
3860 PRINT "WOULD YOU LIKE TO SELL YOUR WATCH";
3870 INPUT J$
3880 IF LEFT$(J$,1)="N" THEN 3970
3890 IF FNA(0)>=7 THEN 3930
3900 PRINT "I'LL GIVE YOU $75 FOR IT."
3910 S=S+75
3920 GOTO 3950
3930 PRINT "THAT'S A PRETTY CRUMMY WATCH - I'LL GIVE YOU $25."
3940 S=S+25
3950 O=O*2
3960 RETURN
3970 IF O/3<>INT(O/3) THEN 4090
3980 PRINT "WILL YOU PART WITH THAT DIAMOND TIE TACK":
3990 INPUT J$
4000 IF LEFT$(J$,1)="N" THEN 4080
4010 IF FNA(0)>=6 THEN 4050
4020 PRINT "YOU ARE NOW $100 RICHER."
4030 S=S+100
4040 GOTO 4070
4050 PRINT "IT'S PASTE.  $25."
4060 S=S+25
4070 O=O*3
4080 RETURN
4090 PRINT "YOUR WAD IS SHOT.  SO LONG, SUCKER!"
4100 END

------------------

-------------------

Do as with the last program listing

Hamurabi.bas

10 PRINT TAB(32);"HAMURABI"
20 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
30 PRINT:PRINT:PRINT
80 PRINT "TRY YOUR HAND AT GOVERNING ANCIENT SUMERIA"
90 PRINT "FOR A TEN-YEAR TERM OF OFFICE.":PRINT
95 D1=0: P1=0
100 Z=0: P=95:S=2800: H=3000: E=H-S
110 Y=3: A=H/Y: I=5: Q=1
210 D=0
215 PRINT:PRINT:PRINT "HAMURABI:  I BEG TO REPORT TO YOU,": Z=Z+1
217 PRINT "IN YEAR";Z;",";D;"PEOPLE STARVED,";I;"CAME TO THE CITY,"
218 P=P+I
227 IF Q>0 THEN 230
228 P=INT(P/2)
229 PRINT "A HORRIBLE PLAGUE STRUCK!  HALF THE PEOPLE DIED."
230 PRINT "POPULATION IS NOW";P
232 PRINT "THE CITY NOW OWNS ";A;"ACRES."
235 PRINT "YOU HARVESTED";Y;"BUSHELS PER ACRE."
250 PRINT "THE RATS ATE";E;"BUSHELS."
260 PRINT "YOU NOW HAVE ";S;"BUSHELS IN STORE.": PRINT
270 IF Z=11 THEN 860
310 C=INT(10*RND(1)): Y=C+17
312 PRINT "LAND IS TRADING AT";Y;"BUSHELS PER ACRE."
320 PRINT "HOW MANY ACRES DO YOU WISH TO BUY";
321 INPUT Q: IF Q<0 THEN 850
322 IF Y*Q<=S THEN 330
323 GOSUB 710
324 GOTO 320
330 IF Q=0 THEN 340
331 A=A+Q: S=S-Y*Q: C=0
334 GOTO 400
340 PRINT "HOW MANY ACRES DO YOU WISH TO SELL";
341 INPUT Q: IF Q<0 THEN 850
342 IF Q<A THEN 350
343 GOSUB 720
344 GOTO 340
350 A=A-Q: S=S+Y*Q: C=0
400 PRINT
410 PRINT "HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE";
411 INPUT Q
412 IF Q<0 THEN 850
418 REM *** TRYING TO USE MORE GRAIN THAN IS IN SILOS?
420 IF Q<=S THEN 430
421 GOSUB 710
422 GOTO 410
430 S=S-Q: C=1: PRINT
440 PRINT "HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED";
441 INPUT D: IF D=0 THEN 511
442 IF D<0 THEN 850
444 REM *** TRYING TO PLANT MORE ACRES THAN YOU OWN?
445 IF D<=A THEN 450
446 GOSUB 720
447 GOTO 440
449 REM *** ENOUGH GRAIN FOR SEED?
450 IF INT(D/2)<=S THEN 455
452 GOSUB 710
453 GOTO 440
454 REM *** ENOUGH PEOPLE TO TEND THE CROPS?
455 IF D<10*P THEN 510
460 PRINT "BUT YOU HAVE ONLY";P;"PEOPLE TO TEND THE FIELDS!  NOW THEN,"
470 GOTO 440
510 S=S-INT(D/2)
511 GOSUB 800
512 REM *** A BOUNTIFUL HARVEST!
515 Y=C: H=D*Y: E=0
521 GOSUB 800
522 IF INT(C/2)<>C/2 THEN 530
523 REM *** RATS ARE RUNNING WILD!!
525 E=INT(S/C)
530 S=S-E+H
531 GOSUB 800
532 REM *** LET'S HAVE SOME BABIES
533 I=INT(C*(20*A+S)/P/100+1)
539 REM *** HOW MANY PEOPLE HAD FULL TUMMIES?
540 C=INT(Q/20)
541 REM *** HORROS, A 15% CHANCE OF PLAGUE
542 Q=INT(10*(2*RND(1)-.3))
550 IF P<C THEN 210
551 REM *** STARVE ENOUGH FOR IMPEACHMENT?
552 D=P-C: IF D>.45*P THEN 560
553 P1=((Z-1)*P1+D*100/P)/Z
555 P=C: D1=D1+D: GOTO 215
560 PRINT: PRINT "YOU STARVED";D;"PEOPLE IN ONE YEAR!!!"
565 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY"
566 PRINT "BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE"
567 PRINT "ALSO BEEN DECLARED NATIONAL FINK!!!!": GOTO 990
710 PRINT "HAMURABI:  THINK AGAIN.  YOU HAVE ONLY"
711 PRINT S;"BUSHELS OF GRAIN.  NOW THEN,"
712 RETURN
720 PRINT "HAMURABI:  THINK AGAIN.  YOU OWN ONLY";A;"ACRES.  NOW THEN,"
730 RETURN
800 C=INT(RND(1)*5)+1
801 RETURN
850 PRINT: PRINT "HAMURABI:  I CANNOT DO WHAT YOU WISH."
855 PRINT "GET YOURSELF ANOTHER STEWARD!!!!!"
857 GOTO 990
860 PRINT "IN YOUR 10-YEAR TERM OF OFFICE,";P1;"PERCENT OF THE"
862 PRINT "POPULATION STARVED PER YEAR ON THE AVERAGE, I.E. A TOTAL OF"
865 PRINT D1;"PEOPLE DIED!!": L=A/P
870 PRINT "YOU STARTED WITH 10 ACRES PER PERSON AND ENDED WITH"
875 PRINT L;"ACRES PER PERSON.": PRINT
880 IF P1>33 THEN 565
885 IF L<7 THEN 565
890 IF P1>10 THEN 940
892 IF L<9 THEN 940
895 IF P1>3 THEN 960
896 IF L<10 THEN 960
900 PRINT "A FANTASTIC PERFORMANCE!!!  CHARLEMANGE, DISRAELI, AND"
905 PRINT "JEFFERSON COMBINED COULD NOT HAVE DONE BETTER!":GOTO 990
940 PRINT "YOUR HEAVY-HANDED PERFORMANCE SMACKS OF NERO AND IVAN IV."
945 PRINT "THE PEOPLE (REMIANING) FIND YOU AN UNPLEASANT RULER, AND,"
950 PRINT "FRANKLY, HATE YOUR GUTS!!":GOTO 990
960 PRINT "YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT"
965 PRINT "REALLY WASN'T TOO BAD AT ALL. ";INT(P*.8*RND(1));"PEOPLE"
970 PRINT "WOULD DEARLY LIKE TO SEE YOU ASSASSINATED BUT WE ALL HAVE OUR"
975 PRINT "TRIVIAL PROBLEMS."
990 PRINT: FOR N=1 TO 10: PRINT CHR$(7);: NEXT N
995 PRINT "SO LONG FOR NOW.": PRINT
999 END

Entry #327

1st Part: "Nostalgia" "Old" Basic Language interpreters, programs, Etc.

Let us start here:

http://awsoftware.org/

http://awsoftware.org/ajwfiles/AWSoftware.exe

http://awsoftware.org/ajwfiles/Classic%20Basic%20Games%20v1_0.zip

http://awsoftware.org/ajwfiles/awbasic.zip

http://awsoftware.org/classiccomputing.htm

http://www.atariarchives.org/basicgames/

http://www.atariarchives.org/basicgames/showpage.php?page=i12

http://www.atariarchives.org/basicgames/showpage.php?page=i13

http://www.atariarchives.org/basicgames/showpage.php?page=i14

http://www.michls.de/troedel/bascomp.html

http://awsoftware.org/ajwfiles/

http://www.trs-80.com/wordpress/info-level-2-basic-language/

---------------

There are some program's listing there on one of the links, but they are as picture files they are too small to be of much use, at least for me, so download them and open with a program such as IrfanView they zoom in on the picture file and then you can better see the basic listings.

Irfanview is a very nice freeware picture viewer and printer you can easily find it with Google.

The TRS80 basic interpreter is called "Trs-80 Basic.exe"

It will load a basic file program listing there called: "Autorun.bas"

Stop it with the Esc Escape key and then use the "File" then "Open" and find another .bas program listing and open it.

You can make your own basic listings with NotePad or with any text editor and then save them as "Name".bas, name being the name that you will give to the basic program that you make (Made).

For example using NotePad type:

10 print "Hello"

Now save that one line as:

Hello.bas

Now open it with the basic interpreter and it will print and show:

Hello

-----------

Easy enough, Right?

Next this will run so fast that you will only see the very end of it:

10 rem Bywater Basic version of 99 Bottles of beer (Bottles.bas)
15 rem See http://www.programmersheaven.com/zone6/cat700/15918.htm
20 rem Philipp Winterberg, http://www.winterbergs.de
30     
40 for b=99 to 1 step -1
50   print str$(b) + " bottle(s) of beer on the wall,"
60   print str$(b) + " bottle(s) of beer."
70   print  "Take one down, pass it around,"
80   print str$(b-1) + " bottle(s) of beer on the wall." + chr$(13) + chr$(10)
90 next b
99 end

-----------

Use Notepad and save as Bottles.bas then open it with the basic interpreter it runs very very fast only the end shows O.K. rerun it a few times so you can better see it as it runs.

-----------

Maybe a better Basic sample of 99 Bottles of Beer On The Wall:

10 FOR B=99 TO 1 STEP -1
20 GOSUB 100
30 T$=T$+" OF BEER ON THE WALL"
40 PRINT T$;", ";T$
50 PRINT "TAKE ONE DOWN AND PASS IT AROUND, "
60 IF B-1<=0 THEN PRINT "NO MORE BOTTLES OF BEER ON THE WALL":GOTO 80
70 GOSUB 200:PRINT " OF BEER ON THE WALL"
80 PRINT:NEXT
91 PRINT "GO TO THE STORE AND BUY SOME MORE, 99 BOTTLES OF BEER ON THE WALL"
92 END
100 T$=STR$(B)+" BOTTLE":IF B>1 THEN T$=T$+"S"
110 RETURN
200 A=B-1:PRINT STR$(A)+" BOTTLE";
210 IF A>1 THEN PRINT "S";
220 RETURN

--------

Also runs very very fast.

There seems to be many ways of doing about the same thing.

-------

I got those Basic listings from the Internet.

I must say that the programs that come with the interpreter are Trash, but the interpreter is good for learning how to use the basic key words and to make text and numbers programs.

-------

It is a bad game, but the listing can teach a little stuff, I wonder why those games are so bad, I guess that good programmers sold their games and not gave them away for free.

10 PRINT TAB(34);"STARS"
20 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
30 PRINT:PRINT:PRINT
100 REM *** STARS - PEOPLE'S COMPUTER CENTER, MENLO PARK, CA
140 REM *** A IS LIMIT ON NUMBER, M IS NUMBER OF GUESSES
150 A=100:M=7
170 INPUT "DO YOU WANT INSTRUCTIONS";A$
190 IF LEFT$(A$,1)="N" THEN 280
200 REM *** INSTRUCTIONS ON HOW TO PLAY
210 PRINT "I AM THINKING OF A WHOLE NUMBER FROM 1 TO";A
220 PRINT "TRY TO GUESS MY NUMBER.  AFTER YOU GUESS, I"
230 PRINT "WILL TYPE ONE OR MORE STARS (*).  THE MORE"
240 PRINT "STARS I TYPE, THE CLOSER YOU ARE TO MY NUMBER."
250 PRINT "ONE STAR (*) MEANS FAR AWAY, SEVEN STARS (*******)"
260 PRINT "MEANS REALLY CLOSE!  YOU GET";M;"GUESSES."
270 REM *** COMPUTER THINKS OF A NUMBER
280 PRINT
290 PRINT
300 X=INT(A*RND(1)+1)
310 PRINT "OK, I AM THINKING OF A NUMBER, START GUESSING."
320 REM *** GUESSING BEGINS, HUMAN GETS M GUESSES
330 FOR K=1 TO M
340 PRINT
350 PRINT "YOUR GUESS";
360 INPUT G
370 IF G=X THEN 600
380 D=ABS(G-X)
390 IF D>=64 THEN 510
400 IF D>=32 THEN 500
410 IF D>=16 THEN 490
420 IF D>=8 THEN 480
430 IF D>=4 THEN 470
440 IF D>=2 THEN 460
450 PRINT "*";
460 PRINT "*";
470 PRINT "*";
480 PRINT "*";
490 PRINT "*";
500 PRINT "*";
510 PRINT "*";
520 PRINT
530 NEXT K
540 REM *** DID NOT GUESS IN M GUESSES
550 PRINT
560 PRINT "SORRY, THAT'S";M;"GUESSES. THE NUMBER WAS";X
580 GOTO 650
590 REM *** WE HAVE A WINNER
600 PRINT:FOR N=1 TO 79
610 PRINT "*";
620 NEXT N
630 PRINT:PRINT
640 PRINT "YOU GOT IT IN";K;"GUESSES!!!  LET'S PLAY AGAIN..."
650 GOTO 280
660 END

Save it as:

stars.bas


Entry #326

Translations

Even if you already know a language or if you are not 100% proficient at it, using online automatic machine translators can help you and also save you a lot of time, yes, you will have to make some corrections, but doing the translating in this way for some people like me can be the only way to go as when I look at a Spanish text i can tell if it has mistakes on it and then I with the help of online dictionaries and translators make corrections, but if I want to write something all by myself without using any help, I will have a lot of trouble, maybe not always, but often enough, speaking and reading is a lot easier to do.

Anyhow, I did the initial from English to Spanish LSA text translation and I was sent a "Free" registration code for that program so I can use it, yes, it took some time and effort to do the translation, but it looks as if it might be of some help for the jackpot lottery games maybe, of course that is to yet be seen, as I have not tried it and won't for some time.

So far the translation's text lines where 204 and most of those lines were very short, there might be some other lines to translate later, but if so I will do them when I have the time to do them.

It is good practice anyway as it makes me remember more Spanish.

LSA seems to predict future random numerical trends based on statistics of the past winning numbers.

TinyMCE this here text editor that the Lottery Post uses is very good, it even has a built in spellchecker option, but a simple one.

 

-------

Entry #325