Current location: Hot Scripts Forums » Programming Languages » Everything Java » how to create a chess game by using java.??


how to create a chess game by using java.??

Reply
  #1 (permalink)  
Old 08-16-05, 04:42 AM
munkit munkit is offline
New Member
 
Join Date: Aug 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
how to create a chess game by using java.??

hai, everyone..im just learn how to use java programing..but i hava a task which is, i hava to create a chess game by using java.So, i wonder how does the Pawn,Casttle,Knight,Bishop,Queen and king movemnt looks like, espeacialy how to implement in java coding?
second, it is have to use an array to create a 2 dimension chess sets?

anyone have any ideas??

Last edited by munkit; 08-16-05 at 04:46 AM. Reason: wrong title
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-16-05, 12:22 PM
Ice_Metal Ice_Metal is offline
Newbie Coder
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
ouch... and i thought black jack was hard to do in a few weeks... that was until my program got erased and i had to re-do the whole thing in 3 days... half the code, 2x greater then before lol. As for chess. well that ones hard. your going to have a fun time with that one lol. but good luck with it. your best bet would be to google it and see if anyone has done this before, and if so... learn from them
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-30-05, 08:04 PM
davidek davidek is offline
Newbie Coder
 
Join Date: Oct 2005
Location: Worcester, UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
I have written a chess game some time ago.

This is one way - but it needs some work to be commercially competitive.

Develop a function to analyse a given position in chess and give it a score. The score might be a count of the material (pieces on the board) and some other factors... such as..

- A queen is worth +90, A rook worth +50... A Pawn worth +10, A King worth +infinity etc.
- If two pawns are on the same file = -5
- For each potential move from this position +1.

You can do an exhuastive search through a tree of every potential move, every possible response, etc.. and use what is known as a minimax method. That is search the tree of moves and take the minimum potential maximum scoring value - meaning that the human player will force you into the minimum possible scoring board.

Then - the computer picks the first move in the tree for that position.

You will find that you can search approximately 4 computer/player moves ahead. Any more than this and the tree grows exponentially - it will be too processor intensive to search further forward. The computer will make surprisingly good moves - but you will probably beat it if you try hard.

I am certain that commercial chess games are far more sophisticated than this.

This is all explained in a book - "Computer Gamesmanship" by David Levy.

If you cannot imagine how to do any of this - I could provide you with my source code. If you make any money from it though - I want my cut
__________________
<A HREF="http://www.mobaholic.com">Mobaholic Ringtones</A>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-23-10, 02:55 PM
vaibhavagar vaibhavagar is offline
New Member
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Mind Games - Chess, in Java

Hi,

I have my project to design a computer playing chess program in java. Please let me know if i can get the source code for it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create an index with Asp.net-vb code kathryn ASP.NET 0 01-04-05 09:39 AM
Re: Porting from java to c++! addit C/C++ 3 09-14-04 05:11 PM
Porting java to C++! addit Everything Java 0 09-06-04 02:03 PM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 01:26 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.