Skip to content

Choose Your Own Adventure - Follow the story of the Little Blue Gopher with this Golang Web Application.

Notifications You must be signed in to change notification settings

cjsidler/go-cyoa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Golang Create Your Own Adventure

Follow the story of the Little Blue Gopher with this Golang Web Application.

Table of Contents
  1. About The Project
  2. Getting Started
  3. License
  4. Contact
  5. Acknowledgments

About The Project

The Golang Create Your Own Adventure web application reads in a story provided by a JSON file in the following format:

{
    "story-arc": {
        "title": "A title for that story arc. Think of it like a chapter title.",
        "story": [
            "A series of paragraphs, each represented as a string in a slice.",
            "This is a new paragraph in this particular story arc."
        ],
        "options": [
            {
                "text": "the text to render for this option. eg 'venture down the dark passage'",
                "arc": "the name of the story arc to navigate to. This will match the story-arc key at the very root of the JSON document"
            }
        ]
    }
}

Each story arc will have a unique key that represents the name of that particular arc, and each adventure will have a story arc with the key "intro" that represents the first story arc of the adventure. Options will be empty if it is the end of that particular story arc. Otherwise, options will have one or more JSON objects that represent an "option" that the reader has at the end of a story arc.

The story is made available to the user using Go templates and http routes. If a user visits the root route (i.e., http://localhost:8080/), the user will be shown the intro story arc.

The story JSON file defaults to "adventure.json", but the user can choose a different file by using the "-filename" flag followed by the name of the JSON file.

(back to top)

Built With

Go HTML CSS

(back to top)

Getting Started

Prerequisites

Installation

  1. Clone the repo
    git clone https://github.com/cjsidler/go-cyoa.git
  2. Build an executable
    go build -o "go-cyoa.exe" main.go
  3. Run the executable.
    .\go-cyoa.exe -filename "mystory.json"

(back to top)

License

MIT License

(back to top)

Contact

Contact me via email, LinkedIn, or GitHub:

Email LinkedIn GitHub

(back to top)

Acknowledgments

(back to top)

About

Choose Your Own Adventure - Follow the story of the Little Blue Gopher with this Golang Web Application.

Topics

Resources

Stars

Watchers

Forks