BASIC languaqe

BASIC languaqe

Post by tang9176 » Wed, 06 Jul 2005 04:16:07


Dear all:

In the old days of programming, I used to be able to write a few
useful programs for my own personal use using BASIC. I had a commodore
and I could write in BASIC.

Heck, even the friends I had who used IBM 86 series computers had
those computers with basic language.

What happened to that language? All of a sudden, it has been 20
years since I have thought about BASIC. But I now have some programs
that I would like to write. I don't know any other language.

I tried to search for BASIC. However, I came up with qBASIC or
VBasic. They are not exactly the same. They don't have to good old:

10 Print "x"
20 input y
30 ? y*10
40 end.

Does anyone know where I can get the good old fashioned BASIC
which still uses the 10, 20, 30 notation?

I have some simple programs that I want to write and I'd like to
be able to just write them without having to learn a whole new
language. I guess you can call me a simple, home programmer who is an
amatuer and who does not need the complexity that comes with learning
something like Java or Visual C++.

Please help point me to the right direction. Is there a place I
can still get good old BASIC?

thx in advance.

signed: HobbyProgrammer
 
 
 

BASIC languaqe

Post by ram » Wed, 06 Jul 2005 04:32:44


XXXX@XXXXX.COM writes:

http://www.yqcomputer.com/

 
 
 

BASIC languaqe

Post by Andreas Ko » Wed, 06 Jul 2005 05:13:49


What about just getting a C64 emulator?


Did you really try QBasic?
Just leave the "." after the end and your above listing will run in
QBasic (MS-DOS QBasic, Version 1.1)
 
 
 

BASIC languaqe

Post by tang9176 » Wed, 06 Jul 2005 07:09:48

I looked over Q-basic. I guess in my haste, I didn't really understand
that I could just write the above and have it run.

For some reason, when I just looked at the tutorials, I didn't see the
10, 20, 30 etc.

Thx for pointing this out :-)

I am glad that even though my original question has now turned out to
be a dumb question (ie because it became obvious that I hadn't taken
sufficient time to really investigated qBASIC thoroughly), I still got
a great answer that is going to help me solve my problem :-).

thx again.
 
 
 

BASIC languaqe

Post by tang9176 » Wed, 06 Jul 2005 07:18:06

I looked over Q-basic. I guess in my haste, I didn't really understand
that I could just write the above and have it run.

For some reason, when I just looked at the tutorials, I didn't see the
10, 20, 30 etc.

Thx for pointing this out :-)

I am glad that even though my original question has now turned out to
be a dumb question (ie because it became obvious that I hadn't taken
sufficient time to really investigated qBASIC thoroughly), I still got
a great answer that is going to help me solve my problem :-).

thx again.
 
 
 

BASIC languaqe

Post by Andreas Ko » Thu, 07 Jul 2005 01:52:48


Thats because the line numbers are optional, so no one voluntarily
uses them any more ;-)

The "new style" is using so called labels just in the line you
actually need them:

x = 1
start: PRINT x
x = x + 1
IF x < 10 GOTO start

instead of

10 x = 1
20 PRINT x
30 x = x + 1
40 IF x < 10 GOTO 20

but it's your choice what to use.
 
 
 

BASIC languaqe

Post by tang9176 » Sun, 10 Jul 2005 02:16:17


Hi there:
Thank you, everyone for replying:

Here is a follow up:

Hi all:

I am the original poster of this thread. With some people's help,
I was able to locate BLASSIC (Blassic.org), which is a free classic
BASIC language that runs in WINDOWS xp. It is nice and I was able to
write some simple stuff for myself using BASIC. However, this is a
slow language which does not compile. I wrote a program with a 20
layered loop sequence. The loops take about 4 to 5 hours to run. And
it causes my computer to run out of virtual memory (900 MB). In fact,
I am not able to complete the calculations I need because the computer
just runs out of memory. Hence, I obviously need to look for a
different language.

My question is: being that I am only a modest BASIC programmer,
what do you think is a logical next language for me to learn? Ideally,
I would like a simple compilable language that is free--I think JAVA is
free. Do you think JAVA is a language that I can easily transition to?
What about C? I am open to suggestions.

I read about Liberty BASIC. I have two concerns: 1. the web site
says it only partially compiles, which means it compiles to an
intermediary language. Hence, even though you can write stand-alone
applications, I worry about the speed of execution. I need programs
with a lot of Loops (ie: FOR x=1 to n : NEXT x). These are large loops
that take a long time to run in BASIC (BLASSIC). I worry that Liberty
BASIC would be still very slow because it isn't truly compiled. So my
question is: Is Liberty BASIC fast? How much faster is it compared to
uncompiled BASIC?

My other concern is that Liberty BASIC costs $54. Being a home
programmer, I don't know that I'd want to spend that kind of money on a
language that I may use two or three times a year.

In summary: what is the next logical language for me to try to
learn? I am looking for a free, compiled language that a person with
BASIC background can easily transition to. I do hope that such a
language exists. I am open for suggestions.

thx in advance.

signed: HomeHobbyProgrammer.
 
 
 

BASIC languaqe

Post by Andreas Ko » Sun, 10 Jul 2005 04:08:11


Sorry, but that looks like either

a) BLASSIC is very poorly implemented (i don't know it, but i don't
think so)
b) Your code is buggy. I guess you aren't an experienced programmer
yet (not meant offensive), so i'd first try to check your
algorithm. I wouldn't expect more than, lets say, factor 100
from a fast compiled language versus a slow interpreted language,
and perhaps factor 5 to 10 in memory usage.

That may sound much, but NO language will calculate something like

for a=0 to 9 ! level 1
for b=0 to 9 ! level 2
...
for t=0 to 9 ! level 20
do something
next t
...
next b
next a

quickly, because its calling "do something"
100.000.000.000.000.000.000 times.
Say we have a CPU with 4 Ghz, 1 cycle per instruction (will be slower
in reality) , and only 1 instruction per "do something" without any time
for the loop counting, that would still be

100.000.000.000.000.000.000 Instructions
/ 4.000.000.000 Instructions per Second

25.000.000.000 Seconds = 792 years






Well, if you didn't even like no-line-numbers, i'd say no chance with
JAVA. Java enforces some advanced things like object orientation that
are pretty much beyond basic.

C is ok but allows starter to make some pretty bad errors.

My personal favourite would be Freepascal (or Delphi if you find
a magazine with a free version on a CD).

For a first impression, i'd suggest having a look at some of the
source codes on my language comparison site :

http://www.yqcomputer.com/

and check if some language suits you.


greetings,
Andreas
 
 
 

BASIC languaqe

Post by tang9176 » Sun, 10 Jul 2005 07:21:30


Andreas Koch wrote:

JESUS! I am amazed at your break down in your reply: ie it would
take 729 years to solve even a 20 layred loop with only 10 cycles in
each loop. That is amazing. [I always figured it would take a while,
but it just goes to show that unless one really sits down to do the
calculation, one really don't have the full appreciation].


Holly cow!

See: I wrote a password analyzing program to check to see how long
it would take an automated computer program to crack a password. Mind
you, I am not writing a "Cracker." Rather, I am writing an "Analyzer."
[I call it an analyzer only because I don't have the know how (yet)
actually "Crack" a live system. I don't have the know how to write a
program that would automatically enter someone's USER ID and enter the
password over and over again until the code is cracked. This is not to
say that I don't want to learn (for fun). I just don't know where to
start to learn that info.]

So, with my limited experience, I wrote a program that asks you to
give a theoretical password: for example: #Top!Secret#. The computer
then goes through and try to guess the word. In this case,
"#Top!Secret#" has twelve letters. Each letter position has 95
different possible characters (26 letters, 10 numbers, + various
symbols + "space" key). This would mean that the computer has to go
through 95^12 number of combinations. In addition, since the computer
does not know how many letters are in your password, it actually has
start with one letter, then 2 letters . . . . This means, by the time
it gets to forming twelve letters, the number of combinations is
actually: 95^1 + 95^2 + 95^3 . . . . + 95^11 +95^12 = 5.46 x 10^23!
According to your above calculation, a 12 letter code would need a 4Ghz
CPU 136,500,000,000,000 seconds = 144,279 yrs!!!
GEESH! I guess that is why long passwords are so safe on the
computer! It would easily 100k+ years to crack!

Back to my BLASSIC program:
My BLASSIC program can solve a simple 5 letter password problem in 4
to 5 hours. Anything beyond that, the computer runs out of memory.
For some reason, as the loops get high up in layers, the virtual memory
builds up and eventually runs out. I am guessing that this means
BLASSIC is poorly implemented. Virtual Memory running out is obviously
a problem with the language platform. I doubt looping would cause a C
compiled language to run out of memory. What do you think? (I am
asking because I don't know).

Any ways, back to my Cracker/Analyzer: I was glad you gave me some
info on the comparison of compiled language vs. Interpretted language.
I didn't realize that there was only, at most, a 100-fold difference
in speed. You really helped give me some frame of reference to
understand that the real problem wasn't so much so that the BLASSIC
interpretted language is too slow. Rather, it was the astronomical
number of Looping exponentials that limits the computer's ability to
guess the code.

It has been a really great learning experience. I think that is
part of the fun of writing these simple programs. There is a lot of
learning to be gained. [my wife and friend ask me: why did I write
such a silly program?. They wanted to know the point of it. There
really was no point--Except maybe I am learning a whole lot about math
and about computers :-) ].

[This reminds me: Today, on the Washington post (7-8-2005) there is an
ar
 
 
 

BASIC languaqe

Post by tang9176 » Sun, 10 Jul 2005 07:22:01


Andreas Koch wrote:

JESUS! I am amazed at your break down in your reply: ie it would
take 729 years to solve even a 20 layred loop with only 10 cycles in
each loop. That is amazing. [I always figured it would take a while,
but it just goes to show that unless one really sits down to do the
calculation, one really don't have the full appreciation].


Holly cow!

See: I wrote a password analyzing program to check to see how long
it would take an automated computer program to crack a password. Mind
you, I am not writing a "Cracker." Rather, I am writing an "Analyzer."
[I call it an analyzer only because I don't have the know how (yet)
actually "Crack" a live system. I don't have the know how to write a
program that would automatically enter someone's USER ID and enter the
password over and over again until the code is cracked. This is not to
say that I don't want to learn (for fun). I just don't know where to
start to learn that info.]

So, with my limited experience, I wrote a program that asks you to
give a theoretical password: for example: #Top!Secret#. The computer
then goes through and try to guess the word. In this case,
"#Top!Secret#" has twelve letters. Each letter position has 95
different possible characters (26 letters, 10 numbers, + various
symbols + "space" key). This would mean that the computer has to go
through 95^12 number of combinations. In addition, since the computer
does not know how many letters are in your password, it actually has
start with one letter, then 2 letters . . . . This means, by the time
it gets to forming twelve letters, the number of combinations is
actually: 95^1 + 95^2 + 95^3 . . . . + 95^11 +95^12 = 5.46 x 10^23!
According to your above calculation, a 12 letter code would need a 4Ghz
CPU 136,500,000,000,000 seconds = 144,279 yrs!!!
GEESH! I guess that is why long passwords are so safe on the
computer! It would easily 100k+ years to crack!

Back to my BLASSIC program:
My BLASSIC program can solve a simple 5 letter password problem in 4
to 5 hours. Anything beyond that, the computer runs out of memory.
For some reason, as the loops get high up in layers, the virtual memory
builds up and eventually runs out. I am guessing that this means
BLASSIC is poorly implemented. Virtual Memory running out is obviously
a problem with the language platform. I doubt looping would cause a C
compiled language to run out of memory. What do you think? (I am
asking because I don't know).

Any ways, back to my Cracker/Analyzer: I was glad you gave me some
info on the comparison of compiled language vs. Interpretted language.
I didn't realize that there was only, at most, a 100-fold difference
in speed. You really helped give me some frame of reference to
understand that the real problem wasn't so much so that the BLASSIC
interpretted language is too slow. Rather, it was the astronomical
number of Looping exponentials that limits the computer's ability to
guess the code.

It has been a really great learning experience. I think that is
part of the fun of writing these simple programs. There is a lot of
learning to be gained. [my wife and friend ask me: why did I write
such a silly program?. They wanted to know the point of it. There
really was no point--Except maybe I am learning a whole lot about math
and about computers :-) ].

[This reminds me: Today, on the Washington post (7-8-2005) there is an
ar
 
 
 

BASIC languaqe

Post by tang9176 » Sun, 10 Jul 2005 07:22:15


Andreas Koch wrote:

JESUS! I am amazed at your break down in your reply: ie it would
take 729 years to solve even a 20 layred loop with only 10 cycles in
each loop. That is amazing. [I always figured it would take a while,
but it just goes to show that unless one really sits down to do the
calculation, one really don't have the full appreciation].


Holly cow!

See: I wrote a password analyzing program to check to see how long
it would take an automated computer program to crack a password. Mind
you, I am not writing a "Cracker." Rather, I am writing an "Analyzer."
[I call it an analyzer only because I don't have the know how (yet)
actually "Crack" a live system. I don't have the know how to write a
program that would automatically enter someone's USER ID and enter the
password over and over again until the code is cracked. This is not to
say that I don't want to learn (for fun). I just don't know where to
start to learn that info.]

So, with my limited experience, I wrote a program that asks you to
give a theoretical password: for example: #Top!Secret#. The computer
then goes through and try to guess the word. In this case,
"#Top!Secret#" has twelve letters. Each letter position has 95
different possible characters (26 letters, 10 numbers, + various
symbols + "space" key). This would mean that the computer has to go
through 95^12 number of combinations. In addition, since the computer
does not know how many letters are in your password, it actually has
start with one letter, then 2 letters . . . . This means, by the time
it gets to forming twelve letters, the number of combinations is
actually: 95^1 + 95^2 + 95^3 . . . . + 95^11 +95^12 = 5.46 x 10^23!
According to your above calculation, a 12 letter code would need a 4Ghz
CPU 136,500,000,000,000 seconds = 144,279 yrs!!!
GEESH! I guess that is why long passwords are so safe on the
computer! It would easily 100k+ years to crack!

Back to my BLASSIC program:
My BLASSIC program can solve a simple 5 letter password problem in 4
to 5 hours. Anything beyond that, the computer runs out of memory.
For some reason, as the loops get high up in layers, the virtual memory
builds up and eventually runs out. I am guessing that this means
BLASSIC is poorly implemented. Virtual Memory running out is obviously
a problem with the language platform. I doubt looping would cause a C
compiled language to run out of memory. What do you think? (I am
asking because I don't know).

Any ways, back to my Cracker/Analyzer: I was glad you gave me some
info on the comparison of compiled language vs. Interpretted language.
I didn't realize that there was only, at most, a 100-fold difference
in speed. You really helped give me some frame of reference to
understand that the real problem wasn't so much so that the BLASSIC
interpretted language is too slow. Rather, it was the astronomical
number of Looping exponentials that limits the computer's ability to
guess the code.

It has been a really great learning experience. I think that is
part of the fun of writing these simple programs. There is a lot of
learning to be gained. [my wife and friend ask me: why did I write
such a silly program?. They wanted to know the point of it. There
really was no point--Except maybe I am learning a whole lot about math
and about computers :-) ].

[This reminds me: Today, on the Washington post (7-8-2005) there is an
ar
 
 
 

BASIC languaqe

Post by tang9176 » Sun, 10 Jul 2005 14:33:10


Andreas Koch wrote:














Wowsers! I am amazed at your break down in your reply: ie it would
take 729 years to solve even a 20 layred loop with only 10 cycles in
each loop. That is amazing. [I always figured it would take a while,
but it just goes to show that unless one really sits down to do the
calculation, one really don't have the full appreciation].

Holly cow!


See: I wrote a password analyzing program to check to see how long
it would take an automated computer program to crack a password. Mind
you, I am not writing a "Cracker." Rather, I am writing an "Analyzer."

[I call it an analyzer only because I don't have the know how (yet) to

actually "Crack" a live system. I don't have the know how to write a
program that would automatically enter someone's USER ID and enter the
password over and over again until the code is cracked. This is not to

say that I don't want to learn (for fun). I just don't know where to
start to learn that info.]


So, with my limited experience, I wrote a program that asks you to
give a theoretical password: for example: #Top!Secret#. The computer
then goes through and try to guess the word. In this case,
"#Top!Secret#" has twelve letters. Each letter position has 95
different possible characters (26 letters, 10 numbers, + various
symbols + "space" key). This would mean that the computer has to go
through 95^12 number of combinations. In addition, since the computer
does not know how many letters are in your password, it actually has
start with one letter, then 2 letters . . . . This means, by the time
it gets to forming twelve letters, the number of combinations is
actually: 95^1 + 95^2 + 95^3 . . . . + 95^11 +95^12 = 5.46 x 10^23!
According to your above calculation, a 12 letter code would need a 4Ghz

CPU 136,500,000,000,000 seconds = 144,279 yrs!!!
GEESH! I guess that is why long passwords are so safe on the
computer! It would easily 100k+ years to crack!


Back to my BLASSIC program:
My BLASSIC program can solve a simple 5 letter password problem in 4

to 5 hours. Anything beyond that, the computer runs out of memory.
For some reason, as the loops get high up in layers, the virtual memory

builds up and eventually runs out. I am guessing that this means
BLASSIC is poorly implemented. Virtual Memory running out is obviously

a problem with the language platform. I doubt looping would cause a C
compiled language to run out of memory. What do you think? (I am
asking because I don't know).


Any ways, back to my Cracker/Analyzer: I was glad you gave me some
info on the comparison of compiled language vs. Interpretted language.
I didn't realize that there was only, at most, a 100-fold difference
in speed. You really helped give me some frame of reference to
understand that the real problem wasn't so much so that the BLASSIC
interpretted language is too slow. Rather, it was the astronomical
number of Looping exponentials that limits the computer's ability to
guess the code.


It has been a really great learning experience. I think that is
part of the fun of writing these simple programs. There is a lot of
learning to be gained. [my wife and friend ask me: why did I write
such a silly program?. They wanted to know the point of it. There
really was no point--Except maybe I am learning a whole lot about math
and about computers :-) ].


[This reminds me: T
 
 
 

BASIC languaqe

Post by Andreas Ko » Sun, 10 Jul 2005 18:03:23


Aaah, good. You remember the combinatorics lessons i allready
forgot again ;-)


That is why password crackers usually rely on dictionaries.
What you are trying to do is called "brute force", and WILL
only work on small passwords, not matter what machine runs it.

Remember, for each additional password character you would need
a 95 times faster computer (simplified view : just 95^n).
Lets say a modern 4 Ghz computer is 95*95=9025 times faster than
a 0.98 Mhz C64 ... than thats just 2 additional password characters
calculatable in the same time!



It could be a memory leak, or your code. Did you check that everything
you store (especially your password strings) are actually what you
except them to be? Perhaps your password doesn't get shortened after
each try, so you end up with a password of 95^12 chars that wouldn't
fit in memory....

For the fun of it, i wrote a litte Delphi code to check (all) passwords
of (exactly) 5 letters, and it estimates 10 minutes on my 1.8 Ghz box.
But i'd say the implementation is mildly optimized, though the code
is ugly ;-)

Glad to help.

Well i sometimes write riddle solvers and such. I use Delphi for that,
just because its my favourite language and not slow.
But i think some functional languages (which are completely different
to code from Basic,C or Pascal/Delphi) would be far better for this,
as they usually have operators like "for each permutation of this
letters do..."

For my riddle solvers, i usually check how long it would take
by implementing it :-)
Ok, i wouldn't try a 12+ letter password brute force cracker, but
in more complex game situations the complexity is hard to estimate, and
you can often optimize quite a bit.


Andreas