GithubHelp home page GithubHelp logo

jmanuel1 / code-jam-f-sharp Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 801 KB

Solutions to some Code Jam problems in F#.

License: MIT License

F# 100.00%
codejam exercise-solutions jam-solutions f-sharp codejam2016 codejam-problems

code-jam-f-sharp's Introduction

My solutions to Code Jam problems

This repo contains my solutions to a few Google Code Jam problems. I first wrote these solutions in 2016, and then ported them to F# and wrapped them in a CLI. They aren't optimal solutions--in fact, one of them is quite slow--but they are my solutions.

Demonstration GIF

Usage

To run a Code Jam solution, type

CodeJam --problem <problem-name>
rem Waits for input.
rem Outputs "Case #1:..."

Like any other Code Jam solution, the input will be taken from stdin, and output will go to stdout.

To get a usage message, run any of the following

CodeJam
CodeJam -h
CodeJam help
CodeJam --help

goto EndExampleOutput
This program can take a single argument --problem which can take the following values
rank-and-file : run a solution to the 2016 Round 1a 'Rank and File' problem
the-last-word : run a solution to the 2016 Round 1a 'The Last Word' problem
coin-jam : run a solution to the 2016 Qualification Round 'Coin Jam' problem

If no arguments are given, or the --help/help/-h argument is given, then this help message is printed.
If the --version/version/-V/-v argument is given, the version of this program is printed.

Input, just like in the real CodeJam, is fed through standard input.
:EndExampleOutput

A usage message is displayed when the arguments are invalid, too.

To find out what version of CodeJam you're using, run any of the following

CodeJam -v
CodeJam -V
CodeJam version
CodeJam --version

rem Outputs "Version #.#.#"

Available solutions

Name Link to problem statement
rank-and-file https://code.google.com/codejam/contest/4304486/dashboard#s=p1
coin-jam https://code.google.com/codejam/contest/6254486/dashboard#s=p2
the-last-word https://code.google.com/codejam/contest/4304486/dashboard

Possible errors

Error code Description
EARGS The program received an invalid combination of arguments.

Reporting issues

Report issues on GitHub.

Acknowledgements

code-jam-f-sharp's People

Contributors

jmanuel1 avatar

Watchers

 avatar  avatar  avatar

code-jam-f-sharp's Issues

Add style guide

Include a style guide for F# code. Perhaps, include a style guide for prose too.

An example F# style guide: https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/

image

An example prose style guide: https://plainlanguage.gov/guidelines/

image

Currently, there is no style guide being followed (except for Visual F#'s suggestions). There should be an F# style guide to follow and prose guidelines to follow. This will help make the code easier to read, better designed, and more maintainable. A prose guide will help improve documentation making it clear and easier to read.

These enhancements would be useful in maintaining the consistency of code and prose.

Add system tests

Test end-user-facing behavior, like:

  • Displaying a usage message in stdout when there are no arguments/invalid arguments
  • Sending error messages to stderr when there no arguments/invalid arguments
  • Running a solution denoted with the arguments --problem <name>
  • Exit with zero upon success
  • Exit with 1 when there are no or invalid arguments

Automate builds, release process, linting, testing

  • Add a code linter to enforce the F# code style
  • Tools to enforce/monitor the prose style guidelines
  • Automate the build process with some CI system that supports MSTest
  • Try automating the release process

Example: DocToc uses Travis CI

image

Currently, no tools like this are being used. I want to use these tools to make the development process less error-prone and to spend more time writing actual code.

The enhancement would be useful because it would codify various development processes and guidelines that I want to use.

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.