summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaiStevenson <kai@kaistevenson.com>2022-11-22 16:29:13 -0800
committerKaiStevenson <kai@kaistevenson.com>2022-11-22 16:29:13 -0800
commit5c80ba6ca83990b50683273fb96fc520112be887 (patch)
treedf3abd4f74df863ea4bdc6e342e35e6aaed11c51
parent3b472236a16565e1f9d2deec4d4ea793db88f972 (diff)
added license and readmeHEADmaster
-rw-r--r--LICENSE21
-rw-r--r--README8
2 files changed, 29 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e090146
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) [2022] [Kai N. Stevenson]
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README b/README
new file mode 100644
index 0000000..e412104
--- /dev/null
+++ b/README
@@ -0,0 +1,8 @@
+Compile ttt.c in whatever manner you like, and run it. Enter coordinates in the form a2, or 1c to select your move.
+The minimax AI will perform a tree search to determine its move. The AI will never lose, and may win if you make a mistake.
+The AI is limited in the sense that it assumes you will play perfectly. It will not attempt to trick you into playing a poor move.
+
+If you wish to modify the code, it should be fairly self-explanatory. There is an array named get_move_ptrs which is defined in main(). This array gives pointers to functions that get input.
+When an X is to be placed, the function pointed to by get_move_ptrs[0] is called. When a Y is to be placed, get_move_ptrs[1].
+To have two human players play against each other, replace each pointer with user_input_pos. For two minimax bots, ai_input_pos.
+To implement a new AI model or new player interface, simply define a function accepting a 2d array (the current board state) and an int (the player whose turn it is). This function must return an int*, with the X coordinate of the move in [0] and the Y coordinate in [1].