• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Rock Paper Scissors

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
CS3.png
[Thumbnail for CS3.png]
CS4.png
[Thumbnail for CS4.png]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic