PDA

View Full Version : Undefeated Toe



Zim
05-29-2014, 03:28 PM
This is non-beatable Tic-Tac-Toe A.I. at it's annoyingly useless best.

I'm starting on writing it now, I'll be done in a few minutes to an hour probably.

Edit: Due to slight rustyness with ZScript and an uncooperative ZC build this is going to take a few more hours.

Gleeok
05-29-2014, 06:35 PM
Heh. Will you add in the ability to specify any arbitrary sized board as well? Also just curious, but how are you doing the AI? I'd imagine it would check for moves based on priority? ie;
-check win move
-check block move
-check move that creates the greatest threat
-check centers(s)

Zim
05-29-2014, 08:09 PM
Yes, I will add in a board variation scripting later... That made me think of other things like methods of using other things on screen to play the game with like lighting torches or pushing magic prisms or something. The comp is done, it always wins or cattail draw, never fails...
In fact, there is no win counter at all, only a loss counter. Press R to reset the board.

The auto-scaling board is almost done, just need to figure out what to do about the drawing the X's and Os.. Probably use draw functions for that too instead of tiling, it looks nice so far.

I'll have it posted tomorrow, it's dinner time and I gotta go.

Zim
05-30-2014, 03:55 PM
Alright!
Someone challenge the Toe!
https://onedrive.live.com/embed?cid=ABAD005DDED52D83&resid=ABAD005DDED52D83%21107&authkey=AHlhBzCnfGyhcIY

Edit: This version IS actually beatable, the one in the post below this one ISN'T.

GrantGreif
05-30-2014, 04:17 PM
I won. It still counted it as a loss, even though the computer goes after you

Zim
05-30-2014, 04:23 PM
I won.

*gasp* :odd:

:poke:

GrantGreif
05-30-2014, 04:26 PM
Middle, bottom right, top right, middle right

Zim
05-30-2014, 04:29 PM
Middle, bottom right, top right, middle right

Hmm... Back to the drawing board!

Zim
05-30-2014, 04:38 PM
Okay, okay, the randomness of the AI's move on that one makes that possible. I had a feeling that that was going to happen yesterday when I finished it's script, and didn't take time to fully beta test it.
This one that's already posted will have to be reduced to 1/3 chance of possibly winning with the right strategy but otherwise non-defeatable tic-tac-toe.

I'm going to fix that and make an actually non-beatable version.
This one is really good for a rupee or item racking guy or something since it's slight possibility that someone can win.

Zim
05-30-2014, 05:04 PM
https://onedrive.live.com/embed?cid=ABAD005DDED52D83&resid=ABAD005DDED52D83%21108&authkey=AEzufvC569kjz84

Here is a new version featuring slightly more randomness and advanced preemptive defense.

Thanks for testing that out Grant, I am fairly certain that is the only strategy I didn't account for in the scripting.

Zim
05-30-2014, 05:10 PM
I won. It still counted it as a loss, even though the computer goes after you

Oops.

GrantGreif
05-30-2014, 05:14 PM
Top, left, middle, bottom
http://www.troll.me/images/aragon/one-day-we-will-stop-winning-but-today-is-not-that-day.jpg

Zim
05-30-2014, 05:17 PM
Top, left, middle, bottom

Alright, one more edit to the script then I'm done for the day.
nm the hacking thing, I overlooked something again.
You're good at tictactoe dude!

Zim
05-30-2014, 05:48 PM
Okay okay, this one should be FLAWLESSLY non-winnable.

https://onedrive.live.com/embed?cid=ABAD005DDED52D83&resid=ABAD005DDED52D83%21109&authkey=AJOWaWUVH0vtg8Q

This one has a flaw that someone can win too.

Zim
05-30-2014, 06:13 PM
One final entry for the day:
https://onedrive.live.com/embed?cid=ABAD005DDED52D83&resid=ABAD005DDED52D83%21110&authkey=AIMES6b5QhSg7L8

I covered every flaw it had and now it blocks and goes for the win every time.

I'm 99.9% certain this one is actually non-winnable.

Comments, please.

GrantGreif
05-30-2014, 06:23 PM
This version still has the bug where the computer sometimes doesn't move.

Zim
05-30-2014, 07:02 PM
This version still has the bug where the computer sometimes doesn't move.

Odd... That still hasn't happened to me.. Are you sure it's not the coloring?
Could you post a pattern that this happens with?
I've tried everything I could think of and the computer makes a move every time.