exercises

package
v0.0.0-...-e61498d Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) int

Decode converts a base 5 SNAFU string to an integer in base 10.

func Encode

func Encode(n int) string

Encode converts an integer in base 10 to a base 5 SNAFU string.

func Pow

func Pow(x, n int) int

Pow returns x^n, the base-x exponential of n.

func Reverse

func Reverse[T any](s []T) []T

Reverse returns a new slice with the elements of s in Reverse order.

Types

type Exercise

type Exercise struct {
	common.BaseExercise
}

Exercise for Advent of Code 2022 day 25.

func (Exercise) One

func (c Exercise) One(instr string) (any, error)

One returns the answer to the first part of the exercise. answer: 2==221=-002=0-02-000

func (Exercise) Two

func (c Exercise) Two(instr string) (any, error)

Two returns the answer to the second part of the exercise. answer:

Jump to

Keyboard shortcuts

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