bowling

package module
v0.0.0-...-24ff1e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2020 License: MIT Imports: 2 Imported by: 0

README

Bowling

A small Go program to calculate the final score of a bowling game.

Run

Run tests with go test.

Documentation

Index

Constants

View Source
const NormalThrowCount = 20

NormalThrowCount is the number of throws in a game not counting bonus throws

View Source
const StrikeScore = 10

StrikeScore is the number of points a strike is worth

Variables

This section is empty.

Functions

func ScoreGame

func ScoreGame(game string) int

ScoreGame calculates the final score of a bowling game. The game is passed in as a string of frames each separated by a '-' (without quotation marks). Strikes are represented with an 'X', spares are represented with a '/', and an open frame is two digits representing the number of pins knocked down by the two throws in that frame.

This function assumes that the game string passed in is a valid game.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL