Documentation
¶
Index ¶
- Constants
- Variables
- func HuhIntRangeOptions(lower, upper int) []huh.Option[int]
- func NormalizeWidth(ascii string) string
- func Overlay(bg, overlay string, row, col int, ignoreMarginWhitespace bool) (string, error)
- func OverlayCenter(bg string, overlay string, ignoreMarginWhitespace bool) (string, error)
- func UpdateTypedModel[T tea.Model](model *T, msg tea.Msg) (tea.Cmd, error)
- type Screen
Constants ¶
View Source
const ( MenuWidth = 50 MenuHeight = 12 // leaderboard files MarathonScoreFile = "internal/leaderboard/data/tetris_marathon_scores.csv" SprintScoreFile = "internal/leaderboard/data/tetris_sprint_scores.csv" UltraScoreFile = "internal/leaderboard/data/tetris_ultra_scores.csv" SnakeScoreFile = "internal/leaderboard/data/snake_scores.csv" ExitScreenTickSpeed = 2 // seconds LoadingTickSpeed = 2 // milliseconds LoadingDotPulseSpeed = 500 // milliseconds // different types of screens for the arcade menus ScreenLoading = Screen(iota) ScreenMainMenu ScreenGameMenu ScreenScoreMenu ScreenLeaderboard // Colors for styling GopherColor = "#00ADD8" DarkerGopherColor = "#0082A8" // Art for arcade machine GopherMascot = `` /* 2366-byte string literal not displayed */ // due to weird formatting had to adjust the braille art here, so even though it looks weird here, // it looks *mostly* fine in the arcade machine GopherMascotSword = `` /* 3745-byte string literal not displayed */ BuffGopher = `` /* 10749-byte string literal not displayed */ )
Variables ¶
View Source
var (
ErrInvalidTypeAssertion = errors.New("invalid type assertion")
)
Functions ¶
func HuhIntRangeOptions ¶
HuhIntRangeOptions creates a new slice of integer options using the lower and upper bound (inclusive).
func NormalizeWidth ¶
helper function to ensure the art for the gopher is always aligned properly
func Overlay ¶
Overlay writes the overlay string onto the background string at the specified row and column. In this case, the row and column are zero indexed.
func OverlayCenter ¶
OverlayCenter writes the overlay string onto the background string such that the middle of the overlay string will be at the middle of the overlay will be at the middle of the background.
Types ¶
Click to show internal directories.
Click to hide internal directories.