File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
Rock Paper Scissors
Joined: Jun 23, 2014
Jun 23, 2014 16:25:01
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.
Joined: Mar 22, 2005
Jun 23, 2014 16:32:44
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 (
) - I think you meant to assign to
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.
Ping & DNS
- my free Android networking tools app
I agree. Here's the link:
subject: Rock Paper Scissors
Birthday Party Invite in Southern California
Adding Ascii / Binary tokens from .txt files
how to insert data in database use jsp and java class and java beans
Tomcat replication question
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014