Code Monkey home page Code Monkey logo

knock-knock-joke-senderreceiver's Introduction

Knock Knock Joke Client & Server

Communicate client side to a Knock Knock Joke server! written in C

Usage on Linux

On server terminal

Compile server.c with gcc make and run the KKJserver.o executable. Specfiy the port number to open for the server by including the port as an argument.

On client terminal

Compile client.c with gcc and run a.out executable. Specfiy the port number to open for the client by including the port as an argument.

Playing with KKJs

By default, the KKJ server will only use the same joke everytime a client connects to it. Including KKJ.txt as an argument allows you to use any jokes formatted in the KKJ.txt file.

You can add your own knock knock jokes to KKJ.txt by following the format below:

SETUP(for joke 1)
PUNCHLINE(for joke 1)

SETUP(for joke 2)
PUNCHLINE(for joke 2)
.
.
.
SETUP(for joke n)
PUNCHLINE(for joke n)

Example client-server exchange:

Server: Knock, knock
Client: Who's there?
Server: SETUP
Client: SETUP who?
Server: PUNCHLINE
Client: insert response here

The KKJ server will send an error messsage and terminate connection if the client responds with anything that does not conform to the KKJ format above

knock-knock-joke-senderreceiver's People

Contributors

foreveracharles avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.