Bill Bennett wrote:
>
> I'm teaching myself QBasic from Schneider's book QBasic with an
> Introduction to VisualBasic. Please, forget the sarcasm:
Okay, Questions like this belong on the Slug-Chat list.
.....snip.....
> According to Schneider, it should be possible using only
> sequence, decision and loop. Perhaps even a loop is unnenessary.
>
> I still can't see how.
what exactly can you not see?
And what was your question?
Hint, programming text writers often write crap for which the answer is
so trivial or they suddenly redefine stuff, or their answer (if they
give it) doesn't meet their criteria. After learning Basic, Fortran,
Algol, Cobol, Lisp, Pascal and C, I've seen this repeatedly.
In O & X's you only need to call nine moves, alternating
white/black/w/b..../w and commence testing after white has made three
moves.
In a non-loop solution, Successive calls (4th, 5th, etc) start with a
test to see if won flag has been set.
In a loop
colour=white
won=no
while not won
do
call move
test for win
change colour
done
annouce winner
If this is a for marks assignment, look at the Scientific American
http://www.sciam.com/ site. I suspect they will have quite a few
analysises (sp?) of the maths behind it all
--
Terry Collins {:-)}}} Ph(02) 4627 2186 Fax(02) 4628 7861
email: [EMAIL PROTECTED] www: http://www.woa.com.au
WOA Computer Services <lan/wan, linux/unix, novell>
"People without trees are like fish without clean water"
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug