Tic-Tac-Toe

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
TomTom224
Newbie
Posts: 1
Joined: Tue Jan 22, 2008 11:56 am

Tic-Tac-Toe

Post by TomTom224 »

Hey guys, I'm having a lot of trouble in QBasic.

I'm trying to figure out the logic I need to use to write Tic-Tac-Toe in QBasic using subscripted variables in order to have the computer be able to make moves. I've worked out that there's an order of logic to use, where first the computer should see if it can win. If it can, make that move. Then it should check if there's any place required to block, and then make that move...And so forth. I'm trying to use loops and subscripted variables, but I just can't seem to get it right. Can someone help me out?
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Can you post what you have so far?
sebman
Newbie
Posts: 1
Joined: Fri Nov 14, 2008 12:31 pm
Location: Holland

Post by sebman »

I think the best way to make the computer 'think' is
-first check all possiblilities for winning in 1 move.
-Then check if the computer can block the human player if he can win in 1 move
-If not both then just put a cross (or circle) near another cross (or circle).

The best to do that is by filling the prog with very much IF statements.
Post Reply