• Post Reply Bookmark Topic Watch Topic
  • New Topic

Code check  RSS feed

 
Andreas Tchikatchika
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
Tried making a more simple program this time.
If anyone got the time to look over it and give some hints your welcome.

It is also up on github: https://github.com/phunlife/FindTheAce/blob/master/Main.java

Program: Guess which card is the Ace!



PS. is there a way to make the Code part of this post to hide/show??

Thank you for !
 
Carey Brown
Saloon Keeper
Posts: 3317
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make a new method printCards( char[][] cards ) and call it. Note that this will work even if you resize the array.


Move cards[row][col] = 'A' so that it is separate from the print loop.
Why are you setting to 'A' for all rows?
Need to do a range check on input.nextInt().
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!