File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes chess game ;array_bug ;selection_of_pieces_in_chess_game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "chess game ;array_bug ;selection_of_pieces_in_chess_game" Watch "chess game ;array_bug ;selection_of_pieces_in_chess_game" New topic
Author

chess game ;array_bug ;selection_of_pieces_in_chess_game

mundva wala
Greenhorn

Joined: Jul 02, 2010
Posts: 6
hey guys ...i am making a project of "CHESS GAME".....
in which to identify any pieces of chess board ,i had used described mechanism....(see code of array)
...
but it actually not working...it takes garbage value...it is working only for the "Rook"...
i can't understand this behavior...so please help me 2 find out d bugs..

you can also give some more efficient mechanism for identify the piece on chess board...

if you know any thing which can help me to make chess game then please post it...hurry up!!

thank you...
mundvawala

array code(jst for idea);
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> so please help me 2 find out d bugs..

generally, line 42 produces the most bugs
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Crossposter!
http://forums.sun.com/thread.jspa?threadID=5443768


luck, db
There are no new questions, but there may be new answers.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Please read HowToAskQuestionsOnJavaRanch, particularly BeForthrightWhenCrossPostingToOtherSites.


Ping & DNS - updated with new look and Ping home screen widget
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> hey guys ...i am making a project of "CHESS GAME".....

...deleted

[edit]
> Please BeNice.. There is no need to be condescending.

point taken, post amended (but it was amusing writing/posting it)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

Please BeNice.. There is no need to be condescending. Not everybody is as good as you or I


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
mundva wala
Greenhorn

Joined: Jul 02, 2010
Posts: 6
sorry to all of you...
it happened only because it was my first post....in future it will never happened..
thank you...

but anyone please help me to develop chess game....that how i should have to select the particular chess pieces ....

thank you
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Code looks good to me. I mean it "should" print out the Strings. So where did you not get the String? Whats the output you get?


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
mundva wala
Greenhorn

Joined: Jul 02, 2010
Posts: 6
@sam Mercs: thank you very much sir.....
it gives the output like
"
bRook
bPawn
null
null
null
null
wRook
wPawn

exception in thread "main" java.lang.arrayindexofboundexception
"

bt i think it should have to print all the elements of array like bRook,bKnight,bBishop...etc

mr.holmes
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

No exception in the code you provided. Maybe the exception is because of some other part in the code.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

"mr holmes", please read your private messages regarding an important announcement.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: chess game ;array_bug ;selection_of_pieces_in_chess_game
 
Similar Threads
I don't know what's wrong with this chess game
NullPointerException : Accessing or modifying the field of a null object?
Help with Chess?
How do i print a table with multidimensional array.
Help with a chess program