If you would like me to get you started, I will be happy to do so
just let me know.
Good Luck!
In fact, here's some code to get you started...
Rem ***** Main Source File *****
Rem Project: #between1-10 v.2
Rem Created: Friday, December 10, 2010
cls
dim players$(10)
global picknumber
Print "Apologies, I have yet to understand how to create a program that can tell who is closest to the number."
print "You will have to guess the number exactly to win. D:"
rem iput name of picker of # and 1st guesser and # value
Print "What is your name?"
Input ">" ,pick$
players$(1)=pick$ :`we can store the players names in a string array
cls
Print "Hello ",pick$, " please think of a number between 1 and 10 and type it below."
num$=""
picknumber=0
while picknumber<1 or picknumber>10 :`you need to use the val command to compare a string variable to a number
input ">",num$ :`indent all commands within loop commands, WHILE, IF, DO, etc.
picknumber=val(num$) :`use the val command to change a string into a number
endwhile :`that way it is easy to see that this WHILE command has a matching ENDWHILE command
cls
Print "Thank you, please have the person guessing your number enter their name."
Input ">", ppl1$
players$(2)=ppl$ :`just storing player 2 name into array also, for later use
cls
print "Hello ",ppl1$, " how many people will be guessing including yourself, ",ppl1$, "."
numpeople=0
repeat
input ">",pplz$
numpeople=val(pplz$)
until numpeople>=1 and numpeople<=5
print "This is as far as the program runs so far..."
print "Press a key to go past this point"
wait key
`--------- You will have to continue from here --------------------------
`if you don't know some of the commands I used, highlight the command and press the f1 key
`the help files are a great way to learn about new commands
rem run program for the correct amount of people
more:
Print "please enter the number of people that will be guessing including yourself, ",ppl1$, "."
input ">" ,numppl$
cls
if numppl=1 then goto 1ppl
if numppl=2 then goto 2ppl
if numppl=3 then goto 3ppl
if numppl=4 then goto 4ppl
if numppl=5
goto 5ppl
else
gosub no
endif
goto more
rem if wrong input is entered program restarts
no:
Print "You did not enter a valid response. Would you like to return a point near where you were last? Type y or n to answer"
input ">", noz$
if noz=y then return
if noz=n
goto endz
else
gosub no
endif
goto no
1ppl:
print "1 person is guessing? Type y or n to answer."
input ">" ,w$
cls
if w=y then goto guessing1
if w=n
goto more
else
gosub no
endif
goto 1ppl
2ppl:
print "2 people are guessing? Type y or n to answer."
input ">" ,w$
cls
if w=y then goto guessing2
if w=n
goto more
else
gosub no
endif
goto 2ppl
3ppl:
print "3 people are guessing? Type y or n to answer."
input ">" ,w$
cls
if w=y then goto guessing3
if w=n
goto more
else
gosub no
endif
goto 3ppl
4ppl:
print "4 people are guessing? Type y or n to answer."
input ">" ,w$
cls
if w=y then goto guessing4
if w=n
goto more
else
gosub no
endif
goto 4ppl
5ppl:
print "5 people are guessing? Type y or n to answer."
input ">" ,w$
cls
if w=y then goto guessing5
if w=n
goto more
else
gosub no
endif
goto 5ppl
guessing1:
Print "Enter your guess"
input ">",guess1
cls
if guess1=num then goto 1win
if guess1<>num
goto lose
else
gosub no
endif
goto guessing1
guessing2:
Print ppl1$, ", please enter your guess. "
input ">",guess1
cls
print "Please have the second player enter their name. "
input ">",ppl2$
cls
print "Hello ",ppl2$,". Please enter your guess. "
input ">",guess2
cls
if guess1=num and guess2<>num then goto 1win
if guess2=num and guess1<>num then goto 2win
if guess1<>num and guess2<> num then goto tie
if guess2=num and guess1=num
goto tie
else
gosub no
endif
goto guessing2
guessing3:
Print ppl1$, ", please enter your guess. "
input ">",guess1
cls
print "Please have the second player enter their name. "
input ">",ppl2$
cls
print "Hello ",ppl2$,". Please enter your guess. "
input ">",guess2
cls
Print "Please have the third player enter their name. "
input ">", ppl3$
cls
Print "Hello ", ppl3$, ". Please enter your guess. "
input ">", guess3
cls
if guess1=num and guess2<>num and guess3<>num then goto 1win
if guess2=num and guess1<>num and guess3<>num then goto 2win
if guess3=num and guess2<>num and Guess1<>num then goto 3win
if guess1<>num and guess2<>num and guess3<>num then goto tie
if guess1=num and guess2=num then goto tie
if guess1=num and guess3=num then goto tie
if guess2=num and guess3=num
goto tie
else
gosub no
endif
goto guessing3
guessing4:
Print ppl1$, ", please enter your guess. "
input ">",guess1
cls
print "Please have the second player enter their name. "
input ">",ppl2$
cls
print "Hello ",ppl2$,". Please enter your guess. "
input ">",guess2
cls
Print "Please have the third player enter their name. "
input ">",ppl3$
cls
Print "Hello ", ppl3$, ". Please enter your guess. "
input ">" ,guess3
cls
Print "Please have the fourth player enter their name. "
input ">" ,ppl4$
cls
Print "Hello ",ppl4$, ". Please enter your guess. "
input ">",guess4
cls
if guess1=num and guess2<>num and guess3<>num and guess4<>num then goto 1win
if guess2=num and guess1<>num and guess3<>num and guess4<>num then goto 2win
if guess3=num and guess2<>num and Guess1<>num and guess4<>num then goto 3win
if guess4=num and guess2<>num and Guess1<>num and guess3<>num then goto 4win
if guess1<>num and guess2<>num and guess3<>num and guess4<>num then goto tie
if guess1=num and guess2=num then goto tie
if guess1=num and guess3=num then goto tie
if guess2=num and guess3=num then goto tie
if guess1=num and guess4=num then goto tie
if guess2=num and guess4=num then goto tie
if guess3=num and guess4=num
goto tie
else
gosub no
endif
goto guessing4
guessing5:
Print ppl1$, ", please enter your guess. "
input ">",guess1
cls
print "Please have the second player enter their name. "
input ">",ppl2$
cls
print "Hello ",ppl2$,". Please enter your guess. "
input ">",guess2
cls
Print "Please have the third player enter their name. "
input ">",ppl3$
cls
Print "Hello ", ppl3$, ". Please enter your guess. "
input ">" ,guess3
cls
Print "Please have the fourth player enter their name. "
input ">" ,ppl4$
cls
Print "Hello ",ppl4$, ". Please enter your guess. "
input ">",guess4
cls
Print "Please have the fifth player enter their name. "
Input ">",ppl5$
cls
Print "Hello ",ppl5$, ". Please enter your guess. "
input ">" ,guess5
cls
if guess1=num and guess2<>num and guess3<>num and guess4<>num and guess5<>num then goto 1win
if guess2=num and guess1<>num and guess3<>num and guess4<>num and guess5<>num then goto 2win
if guess3=num and guess2<>num and Guess1<>num and guess4<>num and guess5<>num then goto 3win
if guess4=num and guess2<>num and Guess1<>num and guess3<>num and guess5<>num then goto 4win
if guess5=num and guess1<>num and guess2<>num and guess3<>num and guess4<>num then goto 5win
if guess1<>num and guess2<>num and guess3<>num and guess4<>num and guess5<>num then goto tie
if guess1=num and guess2=num then goto tie
if guess1=num and guess3=num then goto tie
if guess2=num and guess3=num then goto tie
if guess1=num and guess4=num then goto tie
if guess2=num and guess4=num then goto tie
if guess3=num and guess4=num then goto tie
if guess1=num and guess5=num then goto tie
if guess2=num and guess5=num then goto tie
if guess3=num and guess5=num then goto tie
if guess4=num and guess5=num
goto tie
else
gosub no
endif
goto guessing5
1win:
Print ppl1$, " was closest to the number. ",ppl1$," wins! The number was " ,num, "."
goto again
lose:
Print "Sorry, you guessed the wrong number. The number was actually ",num, "."
goto again
2win:
Print ppl2$, " was closest to the number. ",ppl2$," wins! The number was " ,num, "."
goto again
3win:
Print ppl3$, " was closest to the number. ",ppl3$," wins! The number was " ,num, "."
goto again
4win:
Print ppl4$, " guessed to the number. ",ppl4$," wins! The number was " ,num, "."
goto again
5win:
Print ppl5$, " guessed the number. ",ppl5$," wins! The number was " ,num, "."
goto again
tie:
Print "Either 2 or more people guessed the number, or nobody did. We have a tie. The number was actually " ,num, "."
goto again
again:
Print "Do you want to play again? Type y or n to answer. "
input ">" ,again$
cls
`if again=y then goto number
if again=n
gosub endz
else
gosub no
endif
goto again
endz:
Print "End the program? Type y or n to answer. "
input ">",endz2$
cls
if endz2=y then goto endzz
if endz2=n
return
else
gosub no
endif
goto endz
endzz:
END