Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Last Card Game Question  RSS feed

 
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!


  
 
Rancher
Posts: 3066
33
  • 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?
 
author
Sheriff
Posts: 23507
138
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
 
That new kid is a freak. Show him this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!