Giter Club home page Giter Club logo

eugenrascanu-warplanes_juneresub's Introduction

Warplanes

Warplanes is a Python terminal game, which runs in the Code Institute mock terminal on Heroku.

In my country, we would play the pen-and-paper game "Warplanes". Same game as "Battleship", but with planes.

Responsive Image

How to Play

In this version of the game, the objective is to shoot 5 warplanes out of the sky. When the player starts the app, he will be able to see the board, but not the warplane placement onto that board. The board is 8x8. Rows 1 to 8 and columns A to H. The player has 10 tries, before the game is over.

Features

  • Random generated planes onto the board with each new game
  • The player doesn't see where the planes are placed

Start Image

  • Accepts user input
  • Hits are marked with "X" and miss with "-"

Hit Image

Miss Image

  • After each row and column input, the player is reminded of how many turns he has left
  • You cannot enter a value outside the grid

Valid Row

Valid Col

  • If you repeat the same input, you will not get punished for it, thus you will not loose a turn

Same Input

  • If the 5 warplanes haven't been shot out of the sky within the 10 turns, the game is over

Game Over

  • UPDATED with "Try Again" after finishing the game. The player has the option to either start a new game, by pressing "y" or stop playing by pressing "n"
    • If the player writes any other value other than "y" or "n", the program will ask for the correct value

TryAgain

Retry

  • Python allows us to set up signal -handlers so when a particular signal arrives to our program we can have a behavior different from the default.
    • For example when you run a program on the terminal and press Ctrl-C the default behavior is to quit the program.

CTRL+C

Testing

  • The code has been passed through PEP8 - results found: "All right"

Pep8

  • The app has been tested localy and on the Heroku terminal

Bugs

  • A line in the code block did not follow consistent indenting, thus generating a SyntaxError

SyntaxError

  • When not entering any value, game would break

GameBreak

Remaining Bugs

  • Bugs have been fixed prior deployment

Deployment Steps

  • Code Institute Mock Terminal has been forked
  • Create the Heroku app
  • Buildpacks have been set, as per instructions

Buildpacks

UPDATE ON DEPLOYMENT (17th of May, 2022)

  • Due to a security issue, Heroku has disabled automated deployments from GitHub. In order to deploy, the next steps were used:

    • Enter the following command in the terminal: heroku login -i
    • Enter the following command in the terminal: heroku apps
    • Enter the following command in the terminal: heroku git:remote -a <app_name>
    • Enter the following command in the terminal: git add . && git commit -m "Deploy to Heroku via CLI"
    • Enter the following command in the terminal: git push origin main
    • Enter the following command in the terminal: git push heroku main

Credits

eugenrascanu-warplanes_juneresub's People

Contributors

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