English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

Not easy to find anymore!

Here is a website with several examples:

http://www.runbasic.com/seaside/go/runbasic?_s=PogABMQoYpAvLWwm&_k=lRlTdtTg

There you will find small programs such as this simple Hi-Lo game:

'hilo.bas - Here is an interactive HI-LO program
'Try your hand at modifying this code!

[start]
guessMe = int(rnd(1)*100) + 1

'Clear the screen and print the title and instructions
cls
print "HI-LO"

print ""

print "I have decided on a number between one and a hundred, and I want you to guess"
print "what it is. I will tell you to guess higher or lower, and we will count up"
print "the number of guesses you use."

print ""

[ask]
'Ask the user to guess the number and tally the guess
input "OK. What is your guess?"; guess

cls
guesses$ = guesses$ + str$(guess) + " "
print "Guesses so far: "; guesses$

'Now add one to the count variable to count the guesses
let count = count + 1

'check to see if the guess is right
if guess = guessMe then goto [win]
'check to see if the guess is too low
if guess < guessMe then print "Guess higher."

'check to see if the guess is too high
if guess > guessMe then print "Guess lower."

'go back and ask again
goto [ask]

[win]
'tell how many guesses it took to win
print "You win! It took "; count; " guesses."

'reset the count variable to zero for the next game
let count = 0

'ask to play again
input "Play again (Y/N)"; play$
if instr("YESyes", play$) > 0 then
guesses$ = ""
goto [start]
end if

print "Thanks for playing."
end

2007-03-09 04:17:17 · answer #1 · answered by Captain Al 2 · 1 0

The previous answer about Run BASIC is a good one especially because the site not only has examples of BASIC code, but you can run that code right in your web browser without installing a plugin or any other software by just clicking the Run button on the page. You can also change the code to experiment and run that too. The direct URL to the examples page is http://www.runbasic.com/?_page=examples

There is also a page with lessons at http://www.runbasic.com/?_page=learn

If you want BASIC but don't want it in your web browser there is Liberty BASIC at http://www.libertybasic.com

2007-03-11 09:25:23 · answer #2 · answered by carlgundel 2 · 0 0

Do a google / Yahoo search for: Free visual basic

2007-03-09 12:13:09 · answer #3 · answered by ELfaGeek 7 · 0 0

fedest.com, questions and answers