Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

chess game ;array_bug ;selection_of_pieces_in_chess_game

 
mundva wala
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> so please help me 2 find out d bugs..

generally, line 42 produces the most bugs
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Crossposter!
http://forums.sun.com/thread.jspa?threadID=5443768
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read HowToAskQuestionsOnJavaRanch, particularly BeForthrightWhenCrossPostingToOtherSites.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> 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
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please BeNice.. There is no need to be condescending. Not everybody is as good as you or I
 
mundva wala
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
mundva wala
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No exception in the code you provided. Maybe the exception is because of some other part in the code.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"mr holmes", please read your private messages regarding an important announcement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic