Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
* * * * * 2 votes

Java Source Code: Tic-Tac-Toe Game

tic-tac-toe source code

  • Please log in to reply
80 replies to this topic

#73 AMagic

AMagic

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:C, Java, C++, (Visual) Basic, PL/SQL, Visual Basic .NET, Ada
  • Learning:Java, C++, C#, JavaScript

Posted 03 July 2012 - 03:55 PM

Bro you should make a youtube video tutorial for this program.. U will earn a lot, trust me. =)
  • 0

#74 Dwarfguy721

Dwarfguy721

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Learning:Java

Posted 15 July 2012 - 10:14 AM

I have just started learning java and hope to get atleast as good as this.
Well done!
  • 0

#75 Blmaster

Blmaster

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 28 July 2012 - 04:28 PM

I am happy to see this code helps people out! :) I wish I had the time to make tutorials and learn more programming skills but alas, I have been busy with college the past two years haha.
  • 0

#76 macschmidt33

macschmidt33

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Location:Wisconsin
  • Programming Language:Java, JavaScript
  • Learning:C++, Objective-C, Others

Posted 13 March 2013 - 07:45 AM

Is it even possible to beat the CPU? I think I've tried every possibility... xD Gosh darn it.


  • 0

#77 Ritwik I the programmer

Ritwik I the programmer

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts
  • Programming Language:Java
  • Learning:Java, C++, Python

Posted 29 March 2013 - 02:12 AM

BlMaster, superb job with the AI, but do you know any way to make it undefeatable? It would lengthen that massive if-else if block a bit more, but if you could teach me how to do that, I'd be grateful.


  • 0

I can believe, but why should I?


#78 NawalAlharbi

NawalAlharbi

    CC Lurker

  • New Member
  • Pip
  • 4 posts

Posted 19 April 2013 - 03:04 AM

please i want this game from netbean file

 

that mean save code as project file


  • 0

#79 Polymath

Polymath

    CC Lurker

  • New Member
  • Pip
  • 8 posts

Posted 15 May 2014 - 06:53 PM

Great tutorial, i followed through and enjoyed every single part of it. (With the exception of bugs incurred during retyping.) Do you know of anyway or can you point me to any source to make the CPU play in such a way that it improves over time? so it takes its past results and improves on them?

 

Thanks. Great stuff


  • 0

#80 Chall

Chall

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 349 posts
  • Location:Cedar Rapids, IA
  • Programming Language:Java
  • Learning:C, Java, C++, C#, Python, JavaScript, Assembly

Posted 15 May 2014 - 07:20 PM

Great tutorial, i followed through and enjoyed every single part of it. (With the exception of bugs incurred during retyping.) Do you know of anyway or can you point me to any source to make the CPU play in such a way that it improves over time? so it takes its past results and improves on them?

 

Thanks. Great stuff

That which you have mentioned is actually considered pretty hard to do with most things (effectively that is), even for something simple like this. I guess if you wanted, you could build up an array of moves used (by opponent v AI), and read them after opponent makes each move and see if he is following a pattern, and then you could create a method to select the best "counter" move based on their moves.


  • 0
Speaks fluent Java

#81 Blmaster

Blmaster

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 01 June 2014 - 09:04 PM

The AI is actually not unbeatable. If looked at the code enough and see what it is really doing.

Although if you figure out the pattern, its just going to be either a draw or a win for you over the course of repeating game. 

 

Let's see who can figure out how to beat it! 


  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download