Giter VIP home page Giter VIP logo

pythonbattleship's Introduction

About Me

Hello! My name is Samuel Crawford; I have a B.Eng. in Software Engineering from McMaster University, and I am back at McMaster for my M.A.Sc., working on Drasil. I am the recipient of a Schulich Leader Scholarship for community leadership and academic excellence, and I strive to put my skills to good use wherever I find myself.

Skills

  • My areas of expertise are object-oriented design, functional programming, and software testing
  • My main languages are Python, Haskell, LaTeX, Dart, and Java
  • I am comfortable with common tools and frameworks like Git, Flutter, pytest, and Make
  • I have experience with MATLAB, Bash, C, C++, and SQL

Sam's GitHub stats

pythonbattleship's People

Contributors

samm82 avatar

Watchers

 avatar

pythonbattleship's Issues

Use pop for coordinate list

  • Set a main coordinate list, then pop random values from that to be guessed
    • (ensures that guesses will never be duplicated)
  • Make hard mode pick a random half by splitting it and taking a random choice from the two halves

(Advanced) Salvo Rules Option

As per this wikiHow link there are some variants that could be added to the game.


TODO:

  • Update Main Menu
  • Add salvo rules (know hits/misses)
  • Add advanced salvo rules (don't know hits/misses) -- tricky

Balance Difficulties

After #5 is closed, run a simulation to make sure the difficulties are appropriate, like

[playComp() for _ in range(x)]

where playComp() returns the number of tries it takes and calculates the average.

Remove Duplication

  • There shouldn't need to be a horizontal and a vertical function in answerSub and answerFull.
  • compGuess() has a lot of duplication

Aliasing in answerFull

In threeLong(), all grids are set to the same location, so a change to one changes all of them.

FIX: append a list of "X" coordinates to the answerGrid, and initialize grid from that

Erroneous Attempt Counting

After an invalid guess, a valid guess doesn't make the counter go down in classic (check in submarine)

Reduce duplication

  • menu() - battleship.py
  • compGuess() - classicComp.py
  • Merge play() and playSingle()
    • Shift difficulties (ie. 0 -> 1, etc.) for subComp
    • Add difficulty 0 (for no computer)
  • Pull out into module (Utils?)
    • guessIdentify()
    • genTryHere()
    • genTryFromHits()
    • halfGL()

Implement Testing

Implement testing using pytest (?) for all the modules:

This might require pulling the guessing functionality out a bit

  • submarine
  • submarineComp
  • classic
  • classicComp

Sunken Ship Detection

The program should keep track of what ships are sunk and let the user know when one is sunk, and how many are left.

Computer Player (Two-Way Battleship)

Add the functionality for an actual game of Battleship for:

Find the Submarine

  • Let player pick their ships' locations
  • Make Difficulties:
    • Normal
      • Look for surrounding areas that have been hit
    • Hard
      • Look for hits in a row
      • Look for optimal starting guesses - every other
        • Vary which diagonal is searched

Classic

  • Let player pick their ships' locations
  • Make Difficulties:
    • Easy
      • Guess randomly
    • Normal
      • Look for surrounding areas that have been hit
    • Hard
      • Look for hits in a row
      • Look for optimal starting guesses
  • Cope with ships beside each other (hard) ***
  • play(module, diff)
  • Test pickShip() - balance difficulties (#10)
  • Make player ships not overlap
  • Update README

Vary Board Sizes

Add additional board sizes with different amounts of ships, including the standard one.

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.