Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tic-Tac-Toe in Fortran

Status
Not open for further replies.

efrosini

Technical User
Mar 30, 2013
1
PH
Can anyone help me, how to make borders in a tic-tac-toe game with a dimension of 9x9 and how to input moves in the boxes.
Please and thank you...
 
Do you mean GO or tic-tack-toe (what the Brits call noughts and crosses or OXO)? If you need to know about borders on a 9x9 board, it sounds more like GO. I've never heard of OXO played on a 9x9 before.

1) Do you mean internal borders or drawn borders
2) Is this on the console only or mouse/touch driven
3) Console graphics or drawn graphics. If drawn, which package
4) Which Fortran Compiler/OS are you using?
5) Which version of Fortran are you using (77, 90, 95, 2003, 2008)?

Someone could tell you how to do this using F2008 classes but if you're using F77, it would be a totally useless answer.

If it is internal borders, you need to have set integer values for border, unoccupied, player1 and player2. These are best declared as integer, parameter. How you use these values is up to you. For instance, if border was a greater value than player2, then to check whether someone could use a square, all you need to do is check for .gt. unoccupied. Alternatively, if you have border less than unoccupied, then you'd have to check for .ne. unoccupied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top