acrosslite

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ISO8601 = "2006-01-02T15:04:05.999999"

--------------------------------------------------------------------- Constants and variables ---------------------------------------------------------------------

Variables

This section is empty.

Functions

This section is empty.

Types

type AcrossLite

type AcrossLite struct {
	Size         int
	Name         string
	Title        string
	Author       string
	Copyright    string
	Grid         []string
	AcrossClues  map[int]string
	DownClues    map[int]string
	CreatedDate  time.Time
	ModifiedDate time.Time
}

AcrossLite is a representation of a puzzle in a standard interchange format. This is a proprietary format is defined and maintained by https://www.litsoft.com/. It is described in https://www.litsoft.com/across/docs/AcrossTextFormat.pdf#31

func NewAcrossLite

func NewAcrossLite() *AcrossLite

NewAcrossLite creates and initialized an AcrossLite structure and returns a pointer to it.

func (*AcrossLite) GetAcrossClues

func (self *AcrossLite) GetAcrossClues() map[int]string

GetAcrossClues returns a map of across word numbers to their clues.

func (*AcrossLite) GetAuthor

func (self *AcrossLite) GetAuthor() string

GetAuthor returns the author line

func (*AcrossLite) GetCell

func (self *AcrossLite) GetCell(r, c int) (byte, error)

GetCell returns the letter at a given point in the grid. These are relative to 1, not 0, so

r = 1, 2, ..., n and c = 1, 2, ..., n

If the letter value is '\x00', it is a black cell. Otherwise, it is converted to uppercase. If the letter is not a black cell and not in the alphabet A-Z, an error is returned.

func (*AcrossLite) GetCopyright

func (self *AcrossLite) GetCopyright() string

GetCopyright returns the copyright line

func (*AcrossLite) GetCreatedDate

func (self *AcrossLite) GetCreatedDate() time.Time

GetCreatedDate returns the creation date timestamp. If one has not been specified, uses current date/time.

func (*AcrossLite) GetDownClues

func (self *AcrossLite) GetDownClues() map[int]string

GetAcrossClues returns a map of down word numbers to their clues.

func (*AcrossLite) GetGrid

func (self *AcrossLite) GetGrid() []string

GetGrid returns the list of strings in the grid

func (*AcrossLite) GetModifiedDate

func (self *AcrossLite) GetModifiedDate() time.Time

GetModifiedDate returns the modified date timestamp. If one has not been specified, uses current date/time.

func (*AcrossLite) GetName

func (self *AcrossLite) GetName() string

GetName returns the puzzle name, which will be used as part of the key in the database representation.

This is not the same as the puzzle title

func (*AcrossLite) GetNotepad

func (self *AcrossLite) GetNotepad() string

GetNotepad returns the <NOTEPAD> entry, which may be empty

func (*AcrossLite) GetSize

func (self *AcrossLite) GetSize() int

GetSize returns the number of rows or columns in this puzzle

func (*AcrossLite) GetTitle

func (self *AcrossLite) GetTitle() string

GetTitle returns the puzzle title, which is a descriptive string that is typically used as the heading of the page it is printed on in the newspaper.

func (*AcrossLite) SetAcrossClues

func (self *AcrossLite) SetAcrossClues(clueMap map[int]string)

SetAcrossClues sets the across clue map

func (*AcrossLite) SetAuthor

func (self *AcrossLite) SetAuthor(author string)

SetAuthor sets the author line

func (*AcrossLite) SetCell

func (self *AcrossLite) SetCell(r, c int, letter byte) error

SetCell sets the letter at a given point in the grid. These are relative to 1, not 0, so

r = 1, 2, ..., n and c = 1, 2, ..., n

If the letter value is '\x00', it is a black cell, which must be represented by '.' in this struct element, according to the AcrossLite format.

func (*AcrossLite) SetCopyright

func (self *AcrossLite) SetCopyright(copyright string)

SetCopyright sets the copyright line

func (*AcrossLite) SetCreatedDate

func (self *AcrossLite) SetCreatedDate(created time.Time)

SetCreatedDate sets the creation datetime

func (*AcrossLite) SetDownClues

func (self *AcrossLite) SetDownClues(clueMap map[int]string)

SetDownClues sets the down clue map

func (*AcrossLite) SetModifiedDate

func (self *AcrossLite) SetModifiedDate(modified time.Time)

SetModifiedDate sets the modified datetime

func (*AcrossLite) SetName

func (self *AcrossLite) SetName(name string)

SetName sets the puzzle nme

func (*AcrossLite) SetSize

func (self *AcrossLite) SetSize(n int)

SetSize sets the number of rows or columns in this puzzle

func (*AcrossLite) SetTitle

func (self *AcrossLite) SetTitle(title string)

SetTitle sets the puzzle title

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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