GithubHelp home page GithubHelp logo

hangman-cities-server's Introduction

Hangman Cities Edition (Server)

The classic hangman game with a geographical twist. This server component is designed to be used in conjunction with the iOS client.

Assumptions

  • Each game ends after 10 incorrect guesses
  • Clients shouldn't be shown the word via the API
  • Solo game; no login and no user accounts
  • Hangman is the only game that will be played
  • A-z (and space) are the only characters allowed in the game
  • Uppercase and lowercase are treated as equal

Installation Instructions

Build and run the iOS client and it will connect to a server already running on Heroku. If you wish to run it locally, you can do so by following these steps:

  1. Run bundle install to install Ruby gems
  2. Run ruby hangman.rb and Sinatra will start a local server
  3. Change the iOS client base URL in Game.swift to the local server (default is http://localhost:4567)
  4. Run the iOS client

The local server uses SQLite and Heroku deployment uses Postgres for persistence.

API

POST: /games/new

Creates a new game with a randomly selected word from the list. Returns the game data.

GET: /games

Returns all existing games.

GET: /games/:id

Returns a specific game.

POST: /games/:id/guess

Guess a letter for a game. Requires a letter query parameter that must be one character in the set A-z. e.g. POST /games/1/guess?letter=f. Returns the updated game data.

Acknowledgements

This Sinatra server component is based on https://github.com/sklise/sinatra-api-example.

hangman-cities-server's People

Contributors

alexanderedge 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.