*Don't forget to use Git to save your projects!*

Remember Tic Tac Toe? See Wikipedia if you can't remember the rules, or if you haven't ever played. It involves a couple of players, a simple board, checking for victory in a game loop... all the conditions that make it a fun little problem to solve using our newfound OOP sea legs. Let's build it!

Build a tic-tac-toe game on the command line where two human players can play against each other and the board is displayed in between turns.

- Think about how you would set up the different elements within the game... What should be a class? Instance variable? Method? A few minutes of thought can save you from wasting an hour of coding.
- Build your game, taking care to not share information between classes any more than you have to.
- Post your solution below, then check out the example solution provided.

*Send us your solution so we can show others! Submit a link to the Github repo with your files in it here using any of the methods listed on the contributing page. Please include your partner's github handle somewhere in the description if they would like attribution.*

- Add your solution below this line!
- Omar Moataz's solution
- endotnick's solution
- Jason McKee's Solution (with AI)
- Ben Deltenre's solution | Live Version
- Jason McKee's Solution (with AI)
- Jonathan Yiv's Solution
- GuyInALabCoat's Solution (with AI)
- James B solution
- Bn8's solution (random AI) | Live Version
- Demo318's solution
- justinckim3's solution
- Kasey Z's Solution
- Dallaire's Solution
- adsy430's solution
- SadieD's solution
- Clayton Sweeten's Solution
- holdercp's solution
- xavier solution
- Webdev-burd's solution
- jfonz412's solution
- thisisned's solution
- Oleh Sliusar's solution
- Ovsjah Schweinefresser's solution
- Jerliyah Craig's solution
- theghall's solution
- Andrew Rozhenko's solution
- Alex Chi's solution (with AI)
- Neelotpal's solution
- yilmazgunalp's solution
- ToTenMilan's solution
- Austin Norman's solution
- Nicolas Amaya's solution
- John Phelps's solution
- ricen's solution (with AI)
- Chad Kreutzer's solution
- Jib's Solution
- Charles Munonye's solution
- Stefan P's solution
- Raiko's solution
- Afshinator's solution
- ctcyu's solution
- Jamie's solution
- Chris's solution
- Anh Le's solution
- Donald's solution
- Alan Russell's solution
- Marina Sergeyeva's solution
- TomTom's solution
- Sahil's solution
- Tommy Noe's solution
- Peter Hurford's solution (with AI)
- Michael Alexander's solution
- Steve Mitchell's solution
- Adrian Badarau's solution
- James MacIvor's solution
- Arman Ghassemi's solution
- Gray Olson's solution
- Hawkeye's solution
- Aleksandar Rodić's solution
- Vidul's solution (with AI)
- John Quarles's solution
- Artur Janik's solution
- Dan Molloy's solution
- Hunter Ducharme's solution
- Angela Woods's solution
- Kate McFaul's solution
- Lara Finnegan's solution
- Jason Matthews's solution
- JrodManU's solution
- Sasikala's solution
- Chris Dziewa's solution
- Jeremy Mauzy's solution
- Rafael E's solution
- Kevin Mulhern's solution
- Eleanor Weigert's solution
- Eduardo Frias' solution
- Ryan Jordan's solution
- Brann James' solution
- Frank Peelen' solution
- ll14m4n's solution
- AtActionPark's solution
- Matias Pan's solution
- Mark Viola's solution
- Joe Balsamo's solution
- Dan Hoying's solution
- Rick Stewart's solution
- Miguel Oliveira's solution
- Alex Chen's Solution
- Jake Dexhiemer's Solution
- Xavier Reid's solution (with AI)
- Aleksandre Clapin-Pepin's solution
- John Tobillo's Solution
- PiotrAleksander's Solution
- lynchd2's Solution
- Noah Prescott's Solution
- Panashe Fundira's solution
- Sander Schepens's solution
- Florian Mainguy's Solution
- Aviv Levinsky's Solution (with AI)
- Alex Tsiras' Solution
- Scott Bobbitt's solution
- Sander Schepens's solution
- Giorgos Mitsis's solution
- poctek's solution
- srashidi's solution
- James Brooks's solution
- Dave Meister's solution
- Skye Free's solution
- Jason Mattingly's solution
- cdouglass's solution
- djhart's solution
- Eric's solution (with AI)
- Ricardo Villegas' solution
- Luke Walker's solution
- Matt Velez's solution (with buggy AI)
- Dominik Chomicki's solution
- Miguel Herrera's solution
- Bartlomiej Lazarski's solution (With very buggy AI)
- Matt Leininger's solution
- Max Gallant's solution
- Noobling's solution
- TheBetterNewt's solution
- Zachary Conner's solution
- Benjamin Contant's solution
- Austin Mason's solution
- Vivek Kumar's solution
- John's solution
- Fabricio Carrara's solution (with colors!)
- Francisco Carlos's solution
- Depeak's Solution
- John Connor's solution
- Shala Qweghen's solution
- Earth35's solution
- Cyprium (Stefan)'s solution
- Ryan Armstrong's solution
- Jean Merlet's solution
- Oscar Y.'s solution
- Anthony Vumbaca's solution
- Jiazhi Guo's solution
- Rahul's solution
- Clint's solution
- Leonard Soai-Van's solution
- at0micr3d's solution
- Timur Kharisov's solution
- m-chrzan's solution
- Loris Aranda's solution
- Derek Kwong's solution
- HenrytheDJ's solution (with dumb AI)
- Dom Goj's solution
- Jakub Peikert's solution(with simple AI)
- CodyLBuffaloe's solution
- Hassan's solution
- Kaaviya's solution
- Jerry Gao's solution
- Bishal's solution
- Joe Himes's solution
- Kyle Thomson's solution
- Sophia Wu's solution
- Smilesr's solution
- Braydon's solution
- Pedro's solution
- Jason Keeney's Solution
- nmac's solution (with AI)
- Robert Szabo's solution
- jeff1st's solution
- Niño Mollaneda's solution
- Zach Beaird's solution
- Husein ghafari's solution
- Pat's solution
- Parker Brown's solution (with AI) | Live Version
- Luján Fernaud's solution (with AI)
- EMuchynski's solution (with AI)
- Paritosh's solution
- Neil Cudden's solution
- Roland Studer's solution (with slow learning AI)
- Iceron's solution
- Anistor86's solution

If you've never played Mastermind, a game where you have to guess your opponent's secret code within a certain number of turns (like hangman with colored pegs), check it out on Wikipedia. Each turn you get some feedback about how good your guess was -- whether it was exactly correct or just the correct color but in the wrong space.

Build a Mastermind game from the command line where you have 12 turns to guess the secret code, starting with you guessing the computer's random code.

- Think about how you would set this problem up!
- Build the game assuming the computer randomly selects the secret colors and the human player must guess them. Remember that you need to give the proper feedback on how good the guess was each turn!
- Now refactor your code to allow the human player to choose whether she wants to be the creator of the secret code or the guesser.
- Build it out so that the computer will guess if you decide to choose your own secret colors. Start by having the computer guess randomly (but keeping the ones that match exactly).
- Next, add a little bit more intelligence to the computer player so that, if the computer has guessed the right color but the wrong position, its next guess will need to include that color somewhere. Feel free to make the AI even smarter.
- Post your solution below!

*Send us your solution so we can show others! Submit a link to the Github repo with your files in it here using any of the methods listed on the contributing page. Please include your partner's github handle somewhere in the description if they would like attribution.*

- Add your solution below this line!
- Ben Deltenre's solution | Live Version
- Andrew Rozhenko's solution (with R2D2 for an opponent)
- Jonathan Yiv's Solution (with 20% Win-Rate AI)
- GuyInALabCoat's Solution (with 5 move AI)
- Demo318's solution
- justinckim3's solution
- Kasey Z's Solution
- Dallaire's Solution (With 5 move win AI)
- SadieD's solution
- Clayton Sweeten's Solution
- holdercp's solution
- xavier solution
- jfonz412's solution
- thisisned's solution
- Oleh Sliusar's solution
- Ovsjah Schweinefresser's solution
- Nikolay Dyulgerov's solution
- ToTenMilan's solution
- Ayushka's solution (with AI and colored pegs)
- Austin Norman's solution (No AI)
- John Phelps's solution (No AI)
- Chad Kreutzer's solution (No AI)
- Raiko's solution
- Jib's Solution(No Ai, with UI)
- Stefan P's solution
- Afshinator's solution
- ctcyu's solution
- Donald's solution
- Alan Russell's solution
- Marina Sergeyeva's solution
- TomTom's solution (no AI)
- Sahil's solution
- Michael Alexander's solution
- Adrian Badarau's solution (no AI)
- Arman Ghassemi's solution
- James MacIvor's solution (with AI)
- Hawkeye's solution (with AI)
- Roman's solution (no AI)
- Aleksandar Rodić's solution
- Vidul's solution
- John Quarles's solution
- Artur Janik's solution (no AI)
- Kate McFaul's solution (with AI)
- Dominik Stodolny's solution (with AI)
- Jason Matthews's solution (with AI)
- Chris Dziewa's solution (no AI)
- Kevin Mulhern's solution (with AI)
- Jeremy Mauzy's solution (no AI)
- Rafael E's solution (with AI)
- Eleanor Weigert's solution (with AI and sweet ASCII-art)
- Ryan Jordan's solution
- Chris Hall's solution
- Frank Peelen's solution (TDD with rspec, includes AI)
- Greg Park's solution (with simple AI)
- ll14m4n's solution
- AtActionPark's solution
- Matias Pan's solution(with AI)
- Mark Viola's solution
- Joe Balsamo's solution
- Dan Hoying's solution (with simple AI)
- Rick Stewart's solution (with AI)
- Miguel Oliveira's solution(with and without AI)
- Logan Bresnahan's solution (no AI)
- Xavier Reid's solution (with AI)
- John Tobillo's solution
- Noah Prescott's solution
- Sander Schepens's solution
- Florian Mainguy's solution
- Alex Tsiras' solution
- Scott Bobbitt's solution (with AI)
- Sander Schepens's solution
- Giorgos Mitsis's solution
- poctek's solution
- Adrian Manteza's solution (without AI)
- srashidi's solution (with AI)
- James Brooks's solution
- Dave Meister's solution
- Skye Free's solution
- Jason Mattingly's solution (with AI)
- cdouglass's solution (with AI)
- djhart's solution
- Eric's solution (with AI)
- Ricardo Villegas' solution (with AI)
- Luke Walker's solution (no AI)
- Matt Velez's solution (with AI)
- Dominik Chomicki's solution
- Miguel Herrera's solution (no AI)
- Marina's solution, with AI
- Bartlomiej Lazarski's solution (with badly written AI)
- Tomasz Kula's solution (with AI - 8,68% winrate after 1
*000*000 tries) - Max Gallant's solution (with AI)
- Noobling's soltion
- Matt Leininger's solution (AI 27% win rate)
- Benjamin Contant's solution (AI 100% win rate)
- Austin Mason's solution (No AI at this time)
- John's solution (with AI)
- Fabricio Carrara's solution (own AI and colors!)
- Peuchen's solution (no AI)
- Francisco Carlos's solution
- Deepak's solution
- Shala Qweghen's solution (with AI)
- Earth35's solution (simple AI)
- John Connor's solution (simple AI)
- Jean Merlet's solution
- Oscar Y.'s solution (simple AI)
- Anthony Vumbaca's solution (no AI)
- J-kaizen's solution
- Jiazhi Guo's solution
- Rahul's solution(No AI)
- Clint's solution (with AI)
- at0micr3d's solution
- Chris Chambers' solution (with darn good AI)
- m-chrzan's solution (no AI)
- Loris Aranda's solution
- Timur Kharisov's solution (strong AI)
- Leonard Soai-Van's solution
- Derek Kwong's solution
- Dom Goj's solution
- Jakub Peikert's solution
- David Chapman's solution(Simple AI)
- CodyLBuffaloe's solution with AI
- Hassan's solution
- Jerry Gao's solution
- Marcus' solution (with AI)
- Bishal's solution
- HenrytheDJ's solution (with AI)
- Kyle Thomson's solution (with strong AI, less than 5 moves)
- Sophia Wu's solution (with mediocre AI)
- Braydon's solution(with AI)
- nmac's solution (with AI)
- smilesr's solution (no AI)
- Robert Szabo's solution (simple AI)
- jeff1st's solution
- Niño Mollaneda's solution
- Zach Beaird's solution
- Husein ghafari's solution
- Parker Brown's solution (with AI) | Live Version
- Luján Fernaud's solution (with AI)
- Pat's solution (no AI)
- EMuchynski's solution (no AI)
- EMuchynski's solution (with AI)
- Neil Cudden's solution
- Roland Studer's solution (with AI)
- Iceron's solution (with AI)
- Huy Anh ### Additional Resources

*This section contains helpful links to other content. It isn't required, so consider it supplemental for if you need to dive deeper into something*

- Not directly helpful, but here are some Ruby game libraries for fun.
- A walkthrough of how to build Tic Tac Toe in Ruby from the codequizzes blog.
- An example solution on RosettaCode.org

From the creators of The Odin Project...

The Viking Code School