• Post Reply Bookmark Topic Watch Topic
  • New Topic

Last Card Game Question  RSS feed

 
Mimi Udasco
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone!

I have my last card game question and I am having some trouble I'm hoping you guys can help me with!  So basically given four cards, I'm supposed to return the card with the biggest value. 
The question is:

In a trick-taking card game, four players each play one card in turn. The trick is taken by the highest card played in the suit of the first card. (Ace counts as the highest card, and for simplicity, there are no jokers, trump suits or bowers that some card games have.) Write a method String winningCard(String play) that returns the card that won the trick, when the play to the trick is given as an 8-character string such as “5hKc2dJh”. For this example hand, this method would return “Jh”.

Here is my code!


  
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to wrap any posted code in code tags.

Do you have any specific java programming questions?

 
Mimi Udasco
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is code tags?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mimi Udasco wrote:What is code tags?


See here ... https://coderanch.com/wiki/659781/Wiki/Code-Tags

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!