Giter Club home page Giter Club logo

battleship's Introduction

BATTLESHIP

WARNING

Code is incomplete because it's due on Jun 7th

If you're reading this after Jun 7th its because I forgot to update the readme and the game should (probably) work

A command line battleship client written in python and a backend written in python Sanic

Server must run on python 3.8.10 because Sanic dependencies are very strange

Client can run on >= python 3.8.x

Usage

python main.py

After running the game, follow in game instructions and invite a friend

Running a Battleship server

If you don't want to run your own server, I have one running on http://battleship.ayo.icu

I do not recommend using this because the server it's hosted on is incredibly slow and if you're not on the West Coast of North America the latency will be unbearable.

Config

If you want to run your own server, create a config.json and set the "url" paramter to the url and port you're running the server on.

{
  "url":"http://example.com:port/"
}

Install all dependencies

Python Deps

pip install sanic

Server deps

Run the server on linux/ubuntu because I literally have not tested it on anything else

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

sudo apt-get update
sudo apt-get install redis

Everything else is either using a builtin or will throw an error because I forgor to tell you to install it



The server is made with sanic, so there is probably an exploit in the code that hasn't been found yet. Host at your own risk, I'm just a student learning to code.

battleship's People

Contributors

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