This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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!


  
 
Master Rancher
Posts: 3276
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: 23588
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!