Skip to content

Commit

Permalink
Add documentation, rename package.
Browse files Browse the repository at this point in the history
Other changes:

* Make sure to count foul tip as a swing and miss.
* Add ability to display box score in editor
  • Loading branch information
slshen committed Nov 8, 2024
1 parent 606373e commit 17f28e0
Show file tree
Hide file tree
Showing 72 changed files with 179 additions and 125 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# paperscore

*paperscore* is a paper based softball (and baseball) scoring system for amateur games. The paper score can be re-entered into a computer readable format from which this software can generate box scores and a variety of statistics.
*paperscore* is a hybrid paper-computer softball scoring system that I've been using for the last couple of years to score amateur travel softball games.

Some features and notes:

* The software computes a variety of batting statistics that it can export in CSV format. The CSV files can be imported into any of a number of other systems for additional analysis. Personally I've been using [hex.tech](https://hex.tech).
* The scoring notation and software support entering "alternate plays", which is a play which in the scorers opinion should have occurred. The software can compute the expected run cost of these errors and misplays.
* The scoring notation is derived from [retrosheet](https://www.retrosheet.org).
* The software is incomplete, and undoubtedly has bugs. Some of the code is experimental was just "left in" possibly to be completely later or more likely not at all.
* The error messages leave a lot to be desired. I've found myself running the code in the debugger just to figure out what the actual error was.
* There's a text UI editor for games that I find helpful.

## Sample Paper Score

Here's a sample score sheet:

![Sample Score](/doc/score.jpeg)

4 changes: 2 additions & 2 deletions cmd/alt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"fmt"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/batcount.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"fmt"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/batting_times.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"strings"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"path/filepath"
"strings"

"github.com/slshen/sb/pkg/boxscore"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/boxscore"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/dataexport.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cmd
import (
"fmt"

"github.com/slshen/sb/pkg/dataexport"
"github.com/slshen/sb/pkg/dataframe/pkg"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/paperscore/pkg/dataexport"
"github.com/slshen/paperscore/pkg/dataframe/pkg"
"github.com/slshen/paperscore/pkg/game"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/fmt.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/slshen/sb/pkg/game"
"github.com/slshen/paperscore/pkg/game"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/newgame.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/slshen/sb/pkg/gamefile"
"github.com/slshen/paperscore/pkg/gamefile"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/pitching_times.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"fmt"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/playbyplay.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"log"
"os"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/playbyplay"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/playbyplay"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/re.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/re_args.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cmd

import (
"github.com/slshen/sb/pkg/config"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/config"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/pflag"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/paperscore/pkg/game"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"fmt"

"github.com/slshen/sb/pkg/markov"
"github.com/slshen/sb/pkg/markov/expr"
"github.com/slshen/paperscore/pkg/markov"
"github.com/slshen/paperscore/pkg/markov/expr"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/tournament.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"strings"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/tournament"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/tournament"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"os"

"github.com/slshen/sb/pkg/ui"
"github.com/slshen/paperscore/pkg/ui"
"github.com/spf13/cobra"
)

Expand Down
Binary file added doc/score.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/slshen/sb
module github.com/slshen/paperscore

go 1.22.0

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/slshen/sb/cmd"
"github.com/slshen/paperscore/cmd"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions pkg/boxscore/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"strings"
"text/template"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/playbyplay"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/sb/pkg/text"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/playbyplay"
"github.com/slshen/paperscore/pkg/stats"
"github.com/slshen/paperscore/pkg/text"
)

//go:embed "*.tmpl"
Expand Down
2 changes: 1 addition & 1 deletion pkg/boxscore/box_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"
"testing"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/paperscore/pkg/game"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/boxscore/lineup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"strings"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/sb/pkg/text"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/stats"
"github.com/slshen/paperscore/pkg/text"
)

type Lineup struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/boxscore/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"text/template"

"github.com/slshen/sb/pkg/text"
"github.com/slshen/paperscore/pkg/text"
)

func firstWord(s string, w int) string {
Expand Down
10 changes: 5 additions & 5 deletions pkg/dataexport/dataexport.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"sort"
"time"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/dataframe/pkg"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/sb/pkg/tournament"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/dataframe/pkg"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
"github.com/slshen/paperscore/pkg/tournament"
)

type DataExport struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/dataexport/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"

"github.com/mitchellh/mapstructure"
"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
)

type Event struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataexport/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dataexport
import (
"testing"

"github.com/slshen/sb/pkg/game"
"github.com/slshen/paperscore/pkg/game"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/dataexport/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"path/filepath"

"github.com/slshen/sb/pkg/boxscore"
"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/paperscore/pkg/boxscore"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
)

type Game struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/dataexport/gamestats.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dataexport

import (
"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/sb/pkg/game"
"github.com/slshen/sb/pkg/stats"
"github.com/slshen/paperscore/pkg/dataframe"
"github.com/slshen/paperscore/pkg/game"
"github.com/slshen/paperscore/pkg/stats"
)

type GameStats struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataexport/tournament.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dataexport
import (
"time"

"github.com/slshen/sb/pkg/tournament"
"github.com/slshen/paperscore/pkg/tournament"
)

type Tournament struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataframe/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/mitchellh/mapstructure"
"github.com/slshen/sb/pkg/text"
"github.com/slshen/paperscore/pkg/text"
)

type Update interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataframe/pkg/datapackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"path/filepath"

"github.com/slshen/sb/pkg/dataframe"
"github.com/slshen/paperscore/pkg/dataframe"
)

type License string
Expand Down
2 changes: 1 addition & 1 deletion pkg/game/advance.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package game
import (
"regexp"

"github.com/slshen/sb/pkg/gamefile"
"github.com/slshen/paperscore/pkg/gamefile"
)

type Advance struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/game/advance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package game
import (
"testing"

"github.com/slshen/sb/pkg/gamefile"
"github.com/slshen/paperscore/pkg/gamefile"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/game/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package game
import (
"fmt"

"github.com/slshen/sb/pkg/gamefile"
"github.com/slshen/paperscore/pkg/gamefile"
)

type Error struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/game/fieldingerror.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/slshen/sb/pkg/gamefile"
"github.com/slshen/paperscore/pkg/gamefile"
)

type FieldingError struct {
Expand Down
Loading

0 comments on commit 17f28e0

Please sign in to comment.