Rock, Paper, Scissors game (code included) (Sample Programs)

by Jeremiah Stoddard ⌂ @, Rosarito, Mexico, Sunday, February 06, 2011, 05:24 (3089 days ago) @ tfitz19

If that's out of just one day of programming, then congratulations; that's an impressive feat for a first day.

One possible bug is what if compchoice ends up being exactly .33 or .66? In that (super-rare) case, nothing will get set for compchoice$. I'd suggest changing the >'s to >='s to include those two numbers in the decision making...

#the number decides what the computer picks
if compchoice >= 0 and compchoice < .33 then compchoice$ = "Rock"

if compchoice >= .33 and compchoice < .66 then compchoice$ = "Scissors"

if compchoice >= .66 and compchoice < 1 then compchoice$ = "Paper"

Best,
Jeremiah


Complete thread:

 RSS Feed of thread

powered by my little forum