Java: Peer-to-peer application for a simple question and answer game (using gradle)

  • Status: Pending
  • Prize: $500
  • Entries Received: 7

Contest Brief

Design a simple Question and Answer game.
- The game can ask Short Answer (one word answer) and multiple choice questions.
- one of the signed up peers is always the host (the one asking the questions)
- the host asks the questions, the others answer, whoever answers correctly first gets 1 point;
- the host continues to ask questions until one player receives 5 points (and shouts I WON), then the round is over.
- peers can start a new round or choose to end the game.

Constraints:
- each program is a server and a client (thus peer to peer). (attached is Sockets/SimplePeerToPeer as an example)
- you need to define a custom protocol for this in Protobuf.
- the host sends over a question
- peers can answer correctly or incorrectly
- the host informs the peer if the answer was correct (if it was correct, a switch of hosts takes place)
- write a question bank in JSON and have a json file that you store then in
- the host needs to choose a random question from the question pool and remove the ones the host has already asked; there should be at least 15 questions in the question bank.
- you need a gradle task for running your peers, which also allows to give a host as argument
- you should be able to run your hosts on different systems (raspberry pi, AWS, second computer, etc)

Assumptions:
- you can assume humans playing will choose a host at the beginning, you do not have to do an election or handle when two say they want to be host;
- you can assume humans do not answer at the same time

Recommended Skills

Top entries from this contest

View More Entries

Public Clarification Board

  • RedFish1001
    Contest Holder
    • 3 years ago

    Two hours remaining in the contest. Are there any further clarification from those still working?

    • 3 years ago
  • palthode
    palthode
    • 3 years ago

    Does the game end after the question bank becomes empty? Do we need to add new questions to the question bank after it becomes empty.

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      There needs to be enough questions in the question bank in order for a player to achieve 5 questions correctly. At the end of each game, the question bank should be re-populated with the questions in the json file. If the question bank becomes empty before a player answers 5 correctly, the game ends and the player with the most points wins

      • 3 years ago
  • majkjimajk
    majkjimajk
    • 3 years ago

    Hi, I have some questions: Will the peer-to-peer network run on a LAN? If so, can the system utilize multicasting? If not on a LAN, can we assume each node will have a static ip address? Does the protocol have to be implemented in Protobuf or can we design a simple binary protocol? Is there a particular version of Java that we should use? If the network is not on a LAN and the peers do not have static ip addresses, it will be necessary to do udp NAT transversal. I am in the process of open sourcing our peer-to-peer framework on github: https://github.com/Igram-doo.

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      Assume each node has a static IP address.
      The protocol must be implemented in Protobuf.
      Any version of java is fine, I run with openjdk 11.0.9 but anything 8+ is fine.

      • 3 years ago
  • phjocoronel
    phjocoronel
    • 3 years ago

    hello, in the p2p network all nodes would have to be interconnected?

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      In P2P, at least two nodes would need to connect to start the game. It should be able to accept more than two players, so there might need to be a "wait for more participants".

      • 3 years ago
  • palthode
    palthode
    • 3 years ago

    Is it a Gradle task or direct .java files...Kindly clarify.

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      .java files; the project also requires being compiled with Gradle so a build.gradle file will need to be created with specified tasks inside.

      • 3 years ago
  • palthode
    palthode
    • 3 years ago

    I am working on your project. Kindly don't close the contest before the deadline.

    • 3 years ago
  • MMG2019
    MMG2019
    • 3 years ago

    Hello, Can be made in Visual Basic?

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      As long as it can be executed on the command line interface after building it in visual basic I don't see why not.

      • 3 years ago
  • TaukirKhatri7201
    TaukirKhatri7201
    • 3 years ago

    Okay. Working on it...... :)

    • 3 years ago
  • TaukirKhatri7201
    TaukirKhatri7201
    • 3 years ago

    I just want to clear that the Questions are only that are in data.json file? Means from those questions, one question is taken randomly at a time right?

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      Yes one question from that file taken randomly. You should probably add more questions to the json file have a more solid question bank.

      • 3 years ago
  • TaukirKhatri7201
    TaukirKhatri7201
    • 3 years ago

    Hello, I have a doubt. Can you just reply me???

    • 3 years ago
    1. RedFish1001
      Contest Holder
      • 3 years ago

      What do you need clarification on? I'd be happy to explain.

      • 3 years ago

Show more comments

How to get started with contests

  • Post your contest

    Post Your Contest Quick and easy

  • Get tons of entries

    Get Tons of Entries From around the world

  • Award the best entry

    Award the best entry Download the files - Easy!

Post a Contest Now or Join us Today!