G+_Scott B Posted April 5, 2014 Share Posted April 5, 2014 Tic Tac Toe - in python. i coded this in python in 2012 and i have never coded in python since, one thing i remember is correctly formatting the code correctly is important. hope some one will find this example useful :-) http://pastebin.com/w61Xn3E8 Link to comment Share on other sites More sharing options...
G+_Rene Hasprunar Posted April 12, 2014 Share Posted April 12, 2014 it still works and I totally played a couple of times, very cool Link to comment Share on other sites More sharing options...
G+_Scott B Posted April 12, 2014 Author Share Posted April 12, 2014 thank you. Link to comment Share on other sites More sharing options...
G+_L I Posted April 14, 2014 Share Posted April 14, 2014 I wonder how hard it would be to update it to use some AI for the moves. I suppose you could load every possible counter move in (like always taking the middle if open). Link to comment Share on other sites More sharing options...
G+_Scott B Posted April 14, 2014 Author Share Posted April 14, 2014 i have added a new version with an updated AI http://pastebin.com/YPTcqjeM Link to comment Share on other sites More sharing options...
G+_L I Posted April 15, 2014 Share Posted April 15, 2014 try this as an all-in-one AI function http://pastebin.com/8B1ZVB8B Link to comment Share on other sites More sharing options...
G+_Scott B Posted April 15, 2014 Author Share Posted April 15, 2014 some nice uses of lists, maybe i little complicated for a beginner, nice example though Link to comment Share on other sites More sharing options...
G+_L I Posted April 15, 2014 Share Posted April 15, 2014 Thanks. I tried a couple of different ways before selling on this. This is a fun exercise. Link to comment Share on other sites More sharing options...
Recommended Posts