cyoa

package module
v0.0.0-...-f3e56c7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 4 Imported by: 0

README

cyoa

Web based "Choose Your Own Adventure" game

Usage

The web server is located on cmd/cyoaweb/main.go, and can be ran with:

$ go run cmd/cyoaweb/main.go

The exported types and functions can be found on cyoa.go

License

See LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(s Story, tpl *template.Template) http.HandlerFunc

Types

type Chapter

type Chapter struct {
	Title      string   `json:"title"`
	Paragraphs []string `json:"paragraphs"`
	Options    []Option `json:"options"`
}

type Option

type Option struct {
	Text    string `json:"text"`
	Chapter string `json:"chapter"`
}

type Story

type Story map[string]Chapter

func JsonToStory

func JsonToStory(r io.Reader) (Story, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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