Brontoforumus Archive

Please login or register.

Login with username, password and session length
Advanced search  

News:


This board has been fossilized.
You are reading an archive of Brontoforumus, a.k.a. The Worst Forums Ever, from 2008 to early 2014.  Registration and posting (for most members) has been disabled here to discourage spambots from taking over.  Old members can still log in to view boards, PMs, etc.

The new message board is at http://brontoforum.us.

Pages: [1] 2 3

Author Topic: Kazz's Games  (Read 6823 times)

0 Members and 3 Guests are viewing this topic.

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Kazz's Games
« on: September 24, 2008, 06:58:19 PM »

Tic Tac Toe

You are X, the AI is O.

There is one surefire way to beat it that I know of (with no way around it).  If you do beat it, let me know how you did it, this thing is full of little holes.

It's not even for class, I just wanted to do it.
Logged

Catloaf

  • Tested
  • Karma: 14
  • Posts: 1740
    • View Profile
Re: Kazz's Games
« Reply #1 on: September 24, 2008, 07:07:33 PM »

I won.

bottom row, right middle square and mad skillzdumb luck.


EDIT: tried again. It always seems to work.  X first, (3,1), then (2,3), (3,3), and finally, (1,3)

          (0,0) is up, right, (3,3) is down left.
Logged

patito

  • kodePunc Team
  • Tested
  • *
  • Karma: 14
  • Posts: 1181
    • View Profile
Re: Kazz's Games
« Reply #2 on: September 24, 2008, 07:09:45 PM »

    |    |
__  __  __

    |    |  X
__  __  __

    |    |

_____________________

    |    |
__  __  __

    | O | X
__  __  __

    |    |

_____________________

    |    |
__  __  __

    | O | X
__  __  __

    | X |
_______________________

 O |    |
__  __  __

    | O | X
__  __  __

    | X |

Why would the computer choose this move?
______________________

 O |    |
__  __  __

    | O | X
__  __  __

    | X | X


The end is obvious from here.


Also, it seems to be broken right now.
Logged

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #3 on: September 24, 2008, 07:11:24 PM »

Catloaf: The grid you described is 4x4 and besides that your instructions make no sense to me.

Patito: Because if it can't find anything obvious to block, it picks a square more or less arbitrarily.  I've been finding exceptions like that, I'll squash that one right now.  (It was broken because I was uploading a new one.)
Logged

patito

  • kodePunc Team
  • Tested
  • *
  • Karma: 14
  • Posts: 1181
    • View Profile
Re: Kazz's Games
« Reply #4 on: September 24, 2008, 07:12:52 PM »

It seems to randomly pick the upper left everytime, I tried with the X's on the other side and it did the same attempt block. It worked better in that case though.

T CATLOAF just do what I did.
Logged

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #5 on: September 24, 2008, 07:14:47 PM »

Catloaf, just think of it as a grid going
Code: [Select]
123
456
789
and tell me what moves happened, please.
Logged

Catloaf

  • Tested
  • Karma: 14
  • Posts: 1740
    • View Profile
Re: Kazz's Games
« Reply #6 on: September 24, 2008, 07:20:20 PM »

It was exactly as patito said.  And yeah,  :derp:  my grid numbers were  :facepalm:

Also, 9378 works if you get first turn.

EDIT: so does 7915
Logged

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #7 on: September 24, 2008, 07:24:49 PM »

Yeah.  9378 is a form of the solution.  If you get the first turn, you're unbeatable if you do it, it doesn't matter how the opponent counters.

In retrospect, it would have been nice if my AI performed that trap, but that would take a lot more work than I'm willing to do tonight.
Logged

MadMAxJr

  • Tested
  • Karma: 5
  • Posts: 2339
    • View Profile
    • RPG Q&A
Re: Kazz's Games
« Reply #8 on: September 25, 2008, 06:19:55 AM »

I still can't believe this thing is over 900 lines of code Kazz.  Did you really bruteforce all possible solutions?
Logged
"The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt." - Bertrand Russell

Got questions about RPGs?

Brentai

  • https://www.youtube.com/watch?v=DnXYVlPgX_o
  • Admin
  • Tested
  • Karma: -65281
  • Posts: 17524
    • View Profile
Re: Kazz's Games
« Reply #9 on: September 25, 2008, 07:50:58 AM »

Actionscript, heads, simultaneous pounding.

(Okay I guess that doesn't make sense to some of you: I've said repeatedly before that Actionscript is the equivalent of growing three heads and pounding them all against a brick wall at once.)
Logged

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #10 on: September 25, 2008, 11:47:17 AM »

It isn't concise code.  You can easily halve it if you bother to write functions for stuff instead of copy-pasting the same lines of code over and over.
Logged

Disposable Ninja

  • Tested
  • Karma: -65447
  • Posts: 4529
    • View Profile
Re: Kazz's Games
« Reply #11 on: September 25, 2008, 12:17:16 PM »

surefire way to win if you go first:

Turn 1 - Pick a corner and mark it
Turn 2 - Mark either adjacent corner
Turn 3 - Mark the other adjacent corner
Turn 4 - Win!
Logged

Guild

  • High-Bullshit
  • Tested
  • Karma: -2
  • Posts: 5136
    • View Profile
Re: Kazz's Games
« Reply #12 on: September 25, 2008, 12:52:25 PM »

If you go first:

3915 works as does 1735

i can't find any others of the mark the corners method that work
Logged

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #13 on: September 25, 2008, 03:31:20 PM »

I was told, when I made the program, that there was no way to counter a certain strategy.  As it happens, that is totally incorrect.  There is a way to force a tie in any situation.

The question is, do I want to add it to the program, and make the game unwinnable?
Logged

Friday

  • Admin
  • Tested
  • Karma: -65374
  • Posts: 5122
    • View Profile
Re: Kazz's Games
« Reply #14 on: September 25, 2008, 03:34:23 PM »

Curious game. The only way to win is to nuke the corners first
Logged

Detonator

  • You made me come back for THIS?
  • Admin
  • Tested
  • Karma: 42
  • Posts: 3040
    • View Profile
Re: Kazz's Games
« Reply #15 on: September 25, 2008, 03:39:35 PM »

I was told, when I made the program, that there was no way to counter a certain strategy.  As it happens, that is totally incorrect.  There is a way to force a tie in any situation.

The question is, do I want to add it to the program, and make the game unwinnable?

What are you trying to accomplish here?  A perfect tic-tac-toe program has been around for 56 years, and everyone has learned how to force draws themselves since third grade.  Maybe you misunderstood, and "no way to counter" meant that you could always force a draw, not a win.
Logged
"Imagine punching somebody so hard that they turned into a door. Then you found out that's where ALL doors come from, and you got initiated into a murder club that makes doors. The stronger you punch, the better the door. So there are like super strong murderers who punch people into Venetian doors and shit"

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #16 on: September 25, 2008, 03:56:22 PM »

Well, the kid I was talking to didn't think about it very hard, I guess.  It was late and I had Actionscript for brains.

As a game, making it unwinnable is no fun, so it would just be a programming exercise for me to make it myself.  I'm under no illusion about breaking new ground, here.

I'll just stop touching it.  I hate Tic Tac Toe.
Logged

Friday

  • Admin
  • Tested
  • Karma: -65374
  • Posts: 5122
    • View Profile
Re: Kazz's Games
« Reply #17 on: September 25, 2008, 03:57:48 PM »

show us on the board where the Xs touched you to make you go O
Logged

Detonator

  • You made me come back for THIS?
  • Admin
  • Tested
  • Karma: 42
  • Posts: 3040
    • View Profile
Re: Kazz's Games
« Reply #18 on: September 25, 2008, 04:00:22 PM »

I can't wait until you progress to a Scorched Earth clone with Kazz-style weapons.

:mangun:
Logged
"Imagine punching somebody so hard that they turned into a door. Then you found out that's where ALL doors come from, and you got initiated into a murder club that makes doors. The stronger you punch, the better the door. So there are like super strong murderers who punch people into Venetian doors and shit"

Kazz

  • Projekt Direktor
  • Admin
  • Tested
  • Karma: -65475
  • Posts: 6423
    • View Profile
Re: Kazz's Games
« Reply #19 on: September 25, 2008, 04:14:13 PM »

Physics come soon.  Right now we're just making sure everybody knows how to read input and produce output.  The class itself hasn't done AI yet, I just wanted to do this for fun.
Logged
Pages: [1] 2 3