This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to show previous 5 throws of game rock,paper and scissor

 
sumit jagtap
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i want to show my previous 5 throws on my single JSP page

can anyone help me?
 
Jim Pouwels
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no possible way for us to provide you with a good answer to this question. There's no context what so ever.

What have you developed so far? What code do you have? What's your way of working?
 
sumit jagtap
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hope you know the rock , paper and scissor game, its a small game with some rules i have developed it on using java script.

i want to just know how to display my previous or last 5 throws in my jsp page.



 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read NotACodeMill and ShowSomeEffort. If you show us what you have tried we will be happy to assist you.
 
Stefan Evans
Bartender
Posts: 1755
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To display the last 5 previous throws, you need a data structure to store them.
A list/array of previous results would do.

So after each "match" store the choices and the result into this array, expiring the oldest one if necessary.
To display them, you just need to iterate through the array in order.

 
sumit jagtap
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Stefan Evans
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic