game

package
v0.0.0-...-a4f7991 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCsv

func GetCsv(fileType, fileName string) *os.File

GetCsv based on the fileType and name return a csv file

func QuizzGame

func QuizzGame()

QuizzGame a game which receives a csv with problems and expect the user to answer correctly all on the terminal.

func QuizzQuestions

func QuizzQuestions(p Problem, correct *int, i, totalProblems int, timer time.Timer) error

QuizzQuestions implement a check wether the answer provided from the user is the answer for the defined problem.

Types

type Problem

type Problem struct {
	Question string
	Answer   string
}

Problem based on the csv has a question and answer fields/ to be compared with the user input

func ParseLines

func ParseLines(lines [][]string) []Problem

ParseLines transform a matrix of strings into an array of Problem struct;

Jump to

Keyboard shortcuts

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