Documentation ¶
Index ¶
- Constants
- func BreakLoop(input string) bool
- func CardSelectCounter(input string, count int) int
- func Clear()
- func CreateCards(fileName string, dest *[]Card)
- func CreateTemplate(name, words string) *template.Template
- func FlashcardApp(cards FlashCards, shuffle bool)
- func InSlice(slice []string, s string) bool
- func InputCardFace(input string) string
- func PrintToScreen(templ *template.Template, data interface{}, w io.Writer)
- func TemplateString(c *Card, face string) *template.Template
- type Card
- type Cards
- type FlashCards
Constants ¶
View Source
const ( //CARDFRONT template for the front of the card CARDFRONT = "Card front:\n{{.Front}}\n\n\n" //CARDBACK template for the back of the card CARDBACK = "Card back:\n{{.Back}}\n\n\n" //CARDHINT template for the card hint CARDHINT = "Card hint:\n{{.Hint}}\n\n\n" //HELPTEXT shows the commands HELPTEXT = "\n\n(n)ext (p)revious (f)lip (h)int (q)uit\n" //COUNTERTEXT template for card counter text COUNTERTEXT = "Count: %d/%d\n" //USERINPUTTEXT the template for taking in the user input USERINPUTTEXT = "\nUser input: " //RANDOMCARD used for the random card app RANDOMCARD = "Name: {{.Front}} ({{.Back}}) -- {{.Hint}}\n" //GROUPCARD used for the group card app GROUPCARD = "{{.Front}} ({{.Back}}) -- {{.Hint}}\n" )
Variables ¶
This section is empty.
Functions ¶
func CardSelectCounter ¶
CardSelectCounter use to increment and decrement the card counter
func CreateCards ¶
CreateCards created the flashcards
func CreateTemplate ¶
CreateTemplate is responsible for creating the templates
func FlashcardApp ¶
func FlashcardApp(cards FlashCards, shuffle bool)
FlashcardApp is used to run the terminal flashcard app
func InputCardFace ¶
InputCardFace used to figure out what part of the card the user wants to see
func PrintToScreen ¶
PrintToScreen prints templates to standard out
Types ¶
type Card ¶
type Card struct { Front string `csv:"front"` Back string `csv:"back"` Hint string `csv:"hint"` Flipped bool }
Card is a struct to represent a single flash card
Click to show internal directories.
Click to hide internal directories.