day2

package
v0.0.0-...-26478da Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 3 Imported by: 0

README

2023 Day 2

Learnings

  1. Revision of regexp handling in Go.
  2. Usage of regexp.FindStringSubmatch and regexp.FindAllStringSubmatch.
  3. Proper setup of Game struct to manage parsing of each line of input saved a lot of time when in comes to solving puzzle 2
  4. Unit tests helped a lot too.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	Id    int
	Red   int
	Green int
	Blue  int
}

func NewGame

func NewGame() *Game

func (*Game) Power

func (g *Game) Power() int

func (*Game) SetParameters

func (g *Game) SetParameters(input string) error

func (*Game) WithinLimits

func (g *Game) WithinLimits(red, green, blue int) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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