cmd

package
v0.0.0-...-a648420 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const ELFSEPARATOR int = -100

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Assignment

type Assignment struct {
	PairA Pair
	PairB Pair
}

type AssignmentPairs

type AssignmentPairs struct {
	Assignments    []Assignment
	FullyContained int
	Overlaped      int
}

type CrateStacks

type CrateStacks struct {
	// contains filtered or unexported fields
}

func (*CrateStacks) ApplyMove

func (c *CrateStacks) ApplyMove(move Move)

func (*CrateStacks) ApplyMoves

func (c *CrateStacks) ApplyMoves()

func (*CrateStacks) CloneStack

func (c *CrateStacks) CloneStack()

func (*CrateStacks) GetTops

func (c *CrateStacks) GetTops() ([]string, []string)

func (*CrateStacks) InvertStacks

func (c *CrateStacks) InvertStacks()

type Elf

type Elf struct {
	TotalCalories int
	// contains filtered or unexported fields
}

type Elfs

type Elfs []Elf

func (Elfs) Len

func (e Elfs) Len() int

func (Elfs) Less

func (e Elfs) Less(i, j int) bool

func (Elfs) Swap

func (e Elfs) Swap(i, j int)

type Group

type Group struct {
	Rucksacks []string
	Priority  int
}

type Move

type Move struct {
	Quantity  int
	FromIndex int
	ToIndex   int
}

type Outcome

type Outcome string
const (
	WIN  Outcome = "WIN"
	DRAW Outcome = "DRAW"
	LOSS Outcome = "LOSS"
)

type Pair

type Pair struct {
	Upper int
	Lower int
}

type Play

type Play string
const (
	ROCK     Play = "ROCK"
	PAPER    Play = "PAPER"
	SCISSORS Play = "SCISSORS"
)

func (Play) AchieveOutcome

func (p Play) AchieveOutcome(outcome Outcome) Play

func (Play) LosesAgainst

func (p Play) LosesAgainst() Play

func (Play) Points

func (p Play) Points() int

func (Play) WinsAgainst

func (p Play) WinsAgainst() Play

type Round

type Round struct {
	Opponent       Play
	Me             Play
	DesiredOutcome Outcome
}

func (Round) Score

func (r Round) Score() int

func (Round) ScoreV2

func (r Round) ScoreV2() int

type Rounds

type Rounds []Round

func (Rounds) MyScore

func (r Rounds) MyScore() int

func (Rounds) MyScoreV2

func (r Rounds) MyScoreV2() int

type Rucksack

type Rucksack struct {
	FirstCompartment  string
	SecondCompartment string
	Priority          int
}

type Rucksacks

type Rucksacks struct {
	Rucksacks   []Rucksack
	Groups      []Group
	RucksackSum int
	GroupSum    int
}

type Stack

type Stack []string

func (*Stack) Invert

func (s *Stack) Invert()

func (*Stack) Pop

func (s *Stack) Pop() string

func (*Stack) PopMultiple

func (s *Stack) PopMultiple(n int) []string

func (*Stack) Push

func (s *Stack) Push(e string)

func (*Stack) PushMultiple

func (s *Stack) PushMultiple(elems []string)

func (*Stack) Size

func (s *Stack) Size() int

Jump to

Keyboard shortcuts

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