Giter VIP home page Giter VIP logo

battleship's Introduction

About

Completed over the course of two days as a code sample for a potential internship with Arka for Spring 2017. Uses the Milton-Bradley rules I found on Wikipedia.

Technologies

  • Meteor.js (1.4.1.2)
  • Blaze Templating
  • SCSS Preprocessor (fourseven:scss package)
  • FlowRouter (kadira:flow-router package)
  • BlazeLayout (kadira:blaze-layout package)

How it works

A player hits the 'new game' button to create a new game on the database. The UI then routes to a page to play this game. The link is static and will exist until the game is deleted from the database. The game is also only supported between one human player and one computer player. The human player sets his board (the computer board was set randomly) and then the game continues one attack after the other until one player's ships are all destroyed (copmuter makes attacks randomly).

Notes

I wrote this over Saturday and Sunday, so it's not the most optimal and there are a few graphical glitches, but I feel it is a solid representation of my web skills and knowledge of Meteor / Mongo.

Because of how Blaze renders, I had to create a boolean that only got checked when the game was complete, instead of just existing state variable, since Blaze would prerender the template with a truthy value or something and "flash" the computer board to the player.

Requirements

  • 2 players (Sorta: one is a computer)
  • 2 grids
  • Multiple ships in play at the beginning
  • Players take turns (Live player always goes first)
  • Attack states
    • Hit
    • Miss
    • Already Taken
    • Sunk
    • Win

battleship's People

Contributors

zjijz avatar

Watchers

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