I wouldn't say there's a better programming language. Visual Basic is pretty good, but it doesn't get you familiarized with anything beyond basic programming concepts. C# and Java are based on the same principles, but Java is more portable as it works on any operating system, while C# will work only on Windows. However, the Integrated Development Environment (IDE) you have for C#, Visual Studio, is absolutely superb to use. I'd recommend learning either Java or C#. Once you know one of them, it's easy to learn other other. Good Luck!
Balk
2007-04-25 06:05:21 UTC
I remember Applesoft BASIC.
You'll need to find a reference guide for your version of BASIC for the random number creation instruction.
I don't know if the format is the same with your version of BASIC, but Applesoft's random number generator worked like this:
x=int(rnd(0)*10)+1
x = integer from 1 to 10
x=int(rnd(0)*400)+40
x = integer from 40 to 400
x=(rnd(0)*30)
x = floating point number from 0 to 30
McFate
2007-04-25 06:02:30 UTC
The function "RND" with an integer value greater than one, returns an integer value between 0 and one less than that number.
So, if you want 10 different values, RND(10) will return a random integer between 0 and 9. Since you want 1 to 10, just add one to that.
The program you want is one line long:
===================
PRINT RND(10)+1
===================
jlp.media
2007-04-25 05:56:03 UTC
if you have a TI-83 graphing calculator
create a new program
{
ClrScreen
randInt(1,10,A)
Output(1,1,A)
pause
ClrScreen
}
where all the stuff inside of the brackets is the code
then just run the program, voila
2007-04-25 06:34:27 UTC
i know that in qbasic it would be
randomized timer
x=int(rnd*10)+1
print X
the randomized timer is what makes it random. otherwise everytime you restart the program, you'll get the same random numbers because it would be using the same seed.
i don't know if it is the same for your version. check the help file.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.