This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Applets and the fly likes Rock Paper Scissors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Applets
Bookmark "Rock Paper Scissors" Watch "Rock Paper Scissors" New topic

Rock Paper Scissors

Ben Tam

Joined: Jun 23, 2014
Posts: 1
Hello all. I am new at coding and I am trying to program a game of RPS.

I am very lost and unsure of what I am doing. I attached what I have so far.

[Thumbnail for CS3.png]

[Thumbnail for CS4.png]

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
Welcome to JavaRanch.

You can start by describing what the code does now, how that is different from what you would like it to do, and what particular issues you're facing getting from one to the other.

The immediate problem seems to be that you're comparing strings using the "==" operator instead of the "equals" method. Even though the compiler allows it you need to change that.

The 2nd problem is that you're trying to assign integers to a string variable (tuserchoice) - I think you meant to assign to userchoice instead.

But please, going forward, do not post screenshots - post the code as text. That way it can be searched, and it can be quoted in replies.
Have you checked out Aspose?
subject: Rock Paper Scissors
It's not a secret anymore!