dsvinod90 / knock_knock

Knock-knock game between client and server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

knock_knock

knock_knock.mov

This is a simple knock-knock game played between client and server. It implements tcp-socket programming to simulate the game. All you have to do is start the server and run the client program and the game will proceed.

This game can be run in two modes, interactive (where you will be able to play with the computer) and non-interactive (where the client and server will communicate automatically)

Syntax to run the server:

First complile the code and then run the following code:

  • Non-interactive
java KnockKnockServer -port <port_number> -i no
  • Interactive
java KnockKnockServer -port <port_number> -i yes

Syntax to run the client:

First compile the code and then run the following code:

  • Non-interactive
java KnockKnockClient -host <hostname> -port <port_number> -i no
  • Interactive
java KnockKnockClient -host <hostname> -port <port_number> -i yes

Commands in interactive mode:

Server Your Response
Knock Knock!! who is there?
[name] [name] who?
[punch_line] exit/play again

Note: hostname can be localhost or the ip_address of the client. Make sure that the port_number is the same for the server and client.

About

Knock-knock game between client and server.


Languages

Language:Java 100.0%