Write your Tic-Tac-Toe in language of your choice. Here is example:

Write your Tic-Tac-Toe in language of your choice. Here is example:
github.com/asweigart/my_first_tic_tac_toe/blob/master/tictactoe.py

Attached: drunk cat.jpg (590x550, 34K)

Other urls found in this thread:

github.com/karliekloss/ttt-1-welcome-rb-002
gist.github.com/alessonforposterity/832da4fab11e10609dad/
youtube.com/watch?v=EornBzheSqQ
github.com/asweigart/my_first_tic_tac_toe/blob/master/codegenerator/generate_ttt.py
github.com/asweigart/my_first_tic_tac_toe/blob/master/tictactoe.py
twitter.com/NSFWRedditVideo

>tic-tac-toe
>18 205 Lines

Gee wilikers user, I sure wish my mom let me have 2 extra chromosomes!

Dude.. tell me this is a joke

Attached: tictactoe-cs.png (900x907, 130K)

baited

...right? this is a bait isn't it?

No you stupid fucking retard. This isn't bait. What fucking competent programmer programs like that? Here's a hint: NOBODY

Jesus, retards out on the loose today.

What did you use to generate this code?

You may not like the look of it, but this is what peak performance looks like.

The amount of lines in that repo, is higher than the amount of chromosomes in your head.

>chromosomes in your head
>head

There are chromosomes in your head just like anywhere else in your body

Yes, but they're more specifically in each cell. Saying it was "in your head" implied it was only in your head.

github.com/karliekloss/ttt-1-welcome-rb-002

Kek

>tic-tac-toe game
>18206 lines

Attached: momo.png (528x754, 372K)

Outsider code thread
gist.github.com/alessonforposterity/832da4fab11e10609dad/
Game made without use of any loops
youtube.com/watch?v=EornBzheSqQ

one pic says more than 1000 lines of code.

Attached: tic_tac_toe_large.png (2040x4614, 2.73M)

github.com/asweigart/my_first_tic_tac_toe/blob/master/codegenerator/generate_ttt.py

lol the version i wrote as a kid in c++ had only ~300 lines
and they say c++ is too complex and cumbersome

Thanks, user. I was waiting for this to eventually come up.

how can you lose a game of tic tac toe?
i feel like you only lose a round if you stop paying attention after 50 rounds

Holy fuck. Is that a hardcode of every single possible tic taco to move

to prevent infetterence ;)

Reasonably and in the proper manner: what should be the computers "AI" for tic-tac-toe that'd always end the game in a draw or even win (ignoring implementation details like matrix form)?

>that comma

illiterate negger

Who gives a fuck about an oxford comma

>github.com/asweigart/my_first_tic_tac_toe/blob/master/tictactoe.py
>plot twist
>Someone generated that code with another program

>scan board
>make sure to block winning moves
>make sure to block some patterns that automatically make a player win

For example

X_X
0_0
___

when an X is placed right in the middle X automatically wins. Just need to know these patterns and being able to recognize it

Tic tac toe is one of the few games simple enough to recursively evaluate all possible game states.

You assign win, lose, draw scores of 1, -1, 0 and choose each move to maximize expected score.

This can be done, but an unbeatable AI is harder than you suggest.

While the concept might be easier to understand for a beginner, it will probably be harder to implement than what I suggest.

I wrote tic-tac-toe in Java back in high school that had fewer fucking lines of code than that solution OP. What's worse is the fact I hard coded all the possible solutions.

He's clearly just a hobbyist who's not very good at programming in the first place. There's nothing with writing shit code if you just do it for fun.

>tic taco
is this the mexican version?

I've seen stuff like this on OOP 101 at my Uni (I've been a TA for that course several times).

Is not that bad, that's just how a lot of college kids that learnt to code 2 months ago would naively try to make a program like that.

>how many LOC does your largest project have?
>a bit more than 18k
>wow, dude you must be very good at it.

let's ask him to make a sudoku.

This is because InCels are on this board.

And now show us the code ehich you used to generate this code.

Attached: 38142778_18420844858_180801-131020_bej.jpg (1600x1200, 210K)

>mfw I learnt python basics from his book

what the fuck user, my scholl management system has 3 times less LOC than that thing

Have any of you ever heard the album "Trout Mask Replica" by Captain Beefheart? Probably not. I am infinitely superior to you neckbeards in every single way and my superior taste in music attests to that. I'll bet you lack even the basic ear training necessary to appreciate this Cadillac of the arts.

You will all repose forever in your mother's basement, autistically yelling at your computer screens while the noise of some stupid primitive electronic drum music pounds ominously in the background, screeching for your mother to bring you more tendies. I, meanwhile, will be reclining in perfect ease on my plush leather sofa, sipping a dry martini and listenting to the soothing refrains of the noble Captain Beefheart, crooning away the sounds of the human soul as every woman you have ever loved from afar slobbers on my superior schlong in ways you can only imagine.

Enjoy your virginity, neckbeards.,

Attached: 410RVTQV9EL.jpg (301x300, 31K)

>showing /gee/ your code
prepare to be bullied nerd