TEXAS_JOE Posted August 17, 2011 Share Posted August 17, 2011 When I say AI, I use that term very loosely, it's got a little code that decides upon certain factors but it's nothing special. OXO2.zip 3 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/ Share on other sites More sharing options...
Retrospect Posted January 28, 2021 Share Posted January 28, 2021 TICTAC-X < Runs with XB TICTAC-E,TICTAC-F < Runs with EA/5. Here's the latest update to the "OXO" game. Completely overhauled graphics, uses speech. 7 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4738415 Share on other sites More sharing options...
+Vorticon Posted January 29, 2021 Share Posted January 29, 2021 Great presentation, but the AI is missing a very basic requirement, which is blocking an imminent 3-in-a-row win by the human player. A simple way to mitigate that is to: Represent a player cell as 1, a computer cell as 10, and 0 for an empty cell in a 9 cell single-dimension array (1..9). Have a set of DATA statements with each row containing the cells in the array representing the columns, rows and diagonals as array indices such as below. The order of the cells does not matter. DATA 1,2,3 ! First row DATA 4,5,6 ! Second row etc... Read the DATA sequentially in sets of 3 and check the contents of the indexed array cells, adding them up. For example, if the first row contains 1,0,1, then the total for that row will be 2. If it contains 10,1,0 then it will be 11. Any result of 2 indicates an imminent win by the player and thus the cell in that group that has a 0 in it needs to be claimed by the computer immediately in order to block the win. This should solve that problem 1 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4738947 Share on other sites More sharing options...
+TheBF Posted January 29, 2021 Share Posted January 29, 2021 Hey Vorticon, I looked at your signature and guessed that it meant something like "Creative living until death" Google translate says: "He lives talented and so on are death" What is it really? Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4738974 Share on other sites More sharing options...
Retrospect Posted January 29, 2021 Share Posted January 29, 2021 2 hours ago, Vorticon said: the AI is missing a very basic requirement, which is blocking an imminent 3-in-a-row win by the human player. Hi vorticon I programmed it deliberately to randomly fail. First off it was blocking every single move the player made and never strayed, and this in the end made for a very frustrating experience as every game ended with no winner. So I decided it should not be quite as perfect. There is code in there that detects if the player has two of his markers in a row vertically, horizontally, and diagonally, and it can place it's own marker in the way, but this does not happen all the time. It can even win games against the player. I'll note down your code though so that should I redo it another time I will implement that, it looks more compact than the code I used. Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4739012 Share on other sites More sharing options...
+mizapf Posted January 29, 2021 Share Posted January 29, 2021 vivitur = passive voice of vivere, 3rd person singular ("it is lived", in the sense of "you live") ingenio = ablative case of ingenium ("by the genius", "by the talent") cætera = alternative form of cetera ("the others", cf. "et cetera") mortis = genitive singular ("of the death") erunt = future tense of esse ("will be") I'd translate it as "you live by your genius, everything else will die". In German you could do an almost verbatim translation as "Es wird durch den Geist gelebt; alles andere ist des Todes." 2 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4739106 Share on other sites More sharing options...
+TheBF Posted January 29, 2021 Share Posted January 29, 2021 Latin has 1/2 the "instruction count" versus Deutsch. I would never suspect that. I guess the extra context hides in the Latin conjugations. Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4739175 Share on other sites More sharing options...
+mizapf Posted January 29, 2021 Share Posted January 29, 2021 (edited) Germanic languages lost the synthetic passive voice long ago; that is, we have to construct the passive voice (English "be done", German "getan werden/sein"). German could profit from its inflections more than English (four cases), but as in most other related languages, articles are required, and this is where Latin wins. Essentially, Latin has a very low redundancy, while English and German and most other modern languages show a higher degree. Redundancy in natural languages is not a bad thing. It makes our languages better understandable, with a lower chance of misunderstanding. If you have a look at more distant language families, it is still surprising how many similarities there are in the Indo-European family. Edit: This was my 5k post, but it was not computer-related. I should have checked before. ? Edited January 29, 2021 by mizapf 3 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4739211 Share on other sites More sharing options...
+Vorticon Posted January 30, 2021 Share Posted January 30, 2021 13 hours ago, TheBF said: Hey Vorticon, I looked at your signature and guessed that it meant something like "Creative living until death" Google translate says: "He lives talented and so on are death" What is it really? It means Genius lives on, all else is mortal 2 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4739618 Share on other sites More sharing options...
+Vorticon Posted January 30, 2021 Share Posted January 30, 2021 12 hours ago, Retrospect said: Hi vorticon I programmed it deliberately to randomly fail. First off it was blocking every single move the player made and never strayed, and this in the end made for a very frustrating experience as every game ended with no winner. So I decided it should not be quite as perfect. There is code in there that detects if the player has two of his markers in a row vertically, horizontally, and diagonally, and it can place it's own marker in the way, but this does not happen all the time. It can even win games against the player. I'll note down your code though so that should I redo it another time I will implement that, it looks more compact than the code I used. Got it 1 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4739619 Share on other sites More sharing options...
Retrospect Posted February 5, 2021 Share Posted February 5, 2021 TIC-E,TIC-F,TIC-G <EA5 (someone be kind and build me a cart image! ) TIC-X < XBasic This is my latest and probably final version. The AI is much more cunning. It first looks to see if it can win, then if that's not possible it looks at your markers to try to block you, otherwise it will build up a line of it's own markers. The game now has a much more "TI Feel" to it. It's graphics are similar to the MB Connect-4. There's a little tune in the title screen, it plays until you press a key. 5 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4745058 Share on other sites More sharing options...
ti99iuc Posted February 5, 2021 Share Posted February 5, 2021 3 hours ago, Retrospect said: <EA5 (someone be kind and build me a cart image! ) here TICTACTOE-32K-8.bin and the RPK version TICTACTOE-32K-8.rpk thanks always for your fun games, Retrospect 3 1 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4745133 Share on other sites More sharing options...
Retrospect Posted February 5, 2021 Share Posted February 5, 2021 12 minutes ago, ti99iuc said: here TICTACTOE-32K-8.bin and the RPK version TICTACTOE-32K-8.rpk thanks always for your fun games, Retrospect hey thanks Ciro! good man. 1 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4745137 Share on other sites More sharing options...
+Vorticon Posted February 5, 2021 Share Posted February 5, 2021 Looks great and plays well. Here's a challenge: let the computer play itself by randomly picking cells for each side and check for a win or loss with each move. It will know nothing about strategy. Each game will be stored play by play in a State array of 9 elements with each element representing the entire state of the board for each turn. If a win or loss occurs, the State array will be stored in either a Win or Lose parent array where each element is a State array of a complete game. No need to store games that result in a draw, which should reduce the size of the arrays considerably. After several thousand iterations, the computer should be able to play a perfect game and the way it will do it is as follows: If the computer goes first, then it should randomly pick a game from the Win array. If the computer goes second and for every subsequent computer play, it will check its current position against the Win array for the current turn number: For each element in the Win array, look up the board position for the current turn and keep repeating until a match is found in which case the computer will play the move recorded in the next turn. If no Win array match is found, then the process will be repeated for the Lose array. If a match is found for the current turn, then the cell recorded for the next turn will be marked as excluded in a temporary Exclude array and the computer will keep checking the Lose array in the same manner. Once that process is complete, the computer will randomly pick a cell to play which will not be in the Exclude list. Check for a winning game after each turn, and if none is found after the last cell is played then the game is a draw. The computer cannot lose a game in this process. This is probably what Joshua in War Games did ? 3 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4745203 Share on other sites More sharing options...
Retrospect Posted February 5, 2021 Share Posted February 5, 2021 (edited) I like your idea Vorticon, unfortunately such a thing is beyond my level of coding or comprehension If anyone wants to try this , I can provide the XB256 source code for them to have a go at. TIC TAC TOE REVISION 2a.txt Note: It really didn't HAVE to be in XB256, it's just, that's my go-to coding language I automatically program in that. Edited February 5, 2021 by Retrospect 4 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4745207 Share on other sites More sharing options...
Retrospect Posted February 5, 2021 Share Posted February 5, 2021 (edited) 1 hour ago, Vorticon said: This is probably what Joshua in War Games did ? Edited February 5, 2021 by Retrospect 4 2 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4745247 Share on other sites More sharing options...
GDMike Posted February 6, 2021 Share Posted February 6, 2021 I'm still kicking myself for leaving that computer that's sitting behind him in this photo in an empty apartment that I abandoned in the 80s...kick, kick again... 2 Quote Link to comment https://forums.atariage.com/topic/186448-updated-oxo-game-reworked-ai-and-scoring-system/#findComment-4746555 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.