Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8731349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:13:01+00:00 2026-06-13T09:13:01+00:00

Trying to make this into multiplayer…Needs to be up to 5 players. I have

  • 0

Trying to make this into multiplayer…Needs to be up to 5 players. I have the basics already, just cant figure out how to make it work for multiplayer. The ways that I tried we’re not storing the guesses for each person. This is the stripped down version.

import java.util. * ;

public class randomNumber {

  public static void hint(int answer, int guess) {
    if(answer < guess) {
      System.out.println("Incorrect! \n TOO HIGH!.");
    } else if(answer > guess) {
      System.out.println("Incorrect! \n TOO LOW!.");
    } else if(answer == guess) {
      System.out.println("YOU GOT IT!");
    }
  }

  public static void main(String[] args) {
    System.out.println("How many Players will be playing?");
    int players = players();
    int player = 0;
    player++;
    System.out.println("Player " + player + " Enter a number");
    int guess = guess();
    int answer = random();
    int count = 0;
    while (guess != answer) {
      hint(answer, guess);
      count = count(count);
      guess = guess();
    }
    hint(answer, guess);
    System.out.println("It took " + count(count) + " tries!");

  }

  public static int random() {
    return(int)(Math.random() * 100) + 1;
  }

  public static int players() {
    Scanner my_input = new Scanner(System. in );
    return my_input.nextInt();
  }

  public static int guess() {
    Scanner my_input = new Scanner(System. in );
    return my_input.nextInt();
  }

  public static int count(int c){

    c++;

    return c;
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:13:02+00:00Added an answer on June 13, 2026 at 9:13 am

    You have made a class, it’s the first step in O.O. programming

    But, all your methods are static, it’s a limitation.

    You have to remove all the static keyword but the main and to instantiate your game 5 times.

    It’s the second step in O.O.: the instances.

    Once done you’ll see some details need to be unique, you’ll create a second class, instantiate one time. This class will be in relation with the 5 instances.

    Walk on this way yourself…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make this: 174,myfilename.jpg Into this on the php post process page:
I have been trying to make this to be a little jQuery plugin that
I'm trying to make this look pretty, but I've run into a problem. I
I'm trying to make this information insert into my table in mysql database with
Im trying to make this image fade into the one below it using a
I'm trying to make this: <span class=introduction> <img alt=image src=/picture.jpg /> </span> transform into
i been reading for hours trying to make this work but i dont have
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I am trying to make this sample program work (defn foo ([x] (foo x
I'm trying to make this regex ^(?!\-\-\sRoaming) to match with -- Roaming but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.