Compare commits
3 Commits
ab99f807e8
...
4ffe17fe12
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ffe17fe12 | |||
| 7e759f3b8a | |||
| 87a9c56a77 |
@ -1,4 +1,4 @@
|
|||||||
package aocutils
|
package aoc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
@ -10,7 +10,7 @@ import (
|
|||||||
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/aocutils"
|
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/aocutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Day1Part1(ctx aocutils.Context) (any, error) {
|
func Day1Part1(ctx aoc.Context) (any, error) {
|
||||||
dial := 50
|
dial := 50
|
||||||
solution := 0
|
solution := 0
|
||||||
for pair := range day1GetPairs(ctx.Body) {
|
for pair := range day1GetPairs(ctx.Body) {
|
||||||
@ -28,7 +28,7 @@ func Day1Part1(ctx aocutils.Context) (any, error) {
|
|||||||
return solution, nil
|
return solution, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day1Part2Slow(ctx aocutils.Context) (any, error) {
|
func Day1Part2Slow(ctx aoc.Context) (any, error) {
|
||||||
dial := 50
|
dial := 50
|
||||||
solution := 0
|
solution := 0
|
||||||
for pair := range day1GetPairs(ctx.Body) {
|
for pair := range day1GetPairs(ctx.Body) {
|
||||||
@ -46,7 +46,7 @@ func Day1Part2Slow(ctx aocutils.Context) (any, error) {
|
|||||||
return solution, nil
|
return solution, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day1Part2Fast(ctx aocutils.Context) (any, error) {
|
func Day1Part2Fast(ctx aoc.Context) (any, error) {
|
||||||
dial := 50
|
dial := 50
|
||||||
solution := 0
|
solution := 0
|
||||||
for pair := range day1GetPairs(ctx.Body) {
|
for pair := range day1GetPairs(ctx.Body) {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ func (s *day2Scanner) Bounds() (int, int) {
|
|||||||
return s.a, s.b
|
return s.a, s.b
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day2Part1Simple(ctx aocutils.Context) (any, error) {
|
func Day2Part1Simple(ctx aoc.Context) (any, error) {
|
||||||
input, err := ctx.BodyString()
|
input, err := ctx.BodyString()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to read input: %s", err)
|
return nil, fmt.Errorf("failed to read input: %s", err)
|
||||||
@ -93,7 +93,7 @@ func Day2Part1Simple(ctx aocutils.Context) (any, error) {
|
|||||||
return sum, nil
|
return sum, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day2Part2Simple(ctx aocutils.Context) (any, error) {
|
func Day2Part2Simple(ctx aoc.Context) (any, error) {
|
||||||
input, err := ctx.BodyString()
|
input, err := ctx.BodyString()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to read input: %s", err)
|
return nil, fmt.Errorf("failed to read input: %s", err)
|
||||||
@ -153,8 +153,8 @@ func Day2Part2Simple(ctx aocutils.Context) (any, error) {
|
|||||||
return sum, nil
|
return sum, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day2Part1(ctx aocutils.Context) (any, error) {
|
func Day2Part1(ctx aoc.Context) (any, error) {
|
||||||
scanner := &day2Scanner{scanner: ctx.Scanner(aocutils.SplitComma), sep: '-'}
|
scanner := &day2Scanner{scanner: ctx.Scanner(aoc.SplitComma), sep: '-'}
|
||||||
|
|
||||||
var sum int
|
var sum int
|
||||||
|
|
||||||
@ -178,8 +178,8 @@ func Day2Part1(ctx aocutils.Context) (any, error) {
|
|||||||
return sum, scanner.Err()
|
return sum, scanner.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day2Part2(ctx aocutils.Context) (any, error) {
|
func Day2Part2(ctx aoc.Context) (any, error) {
|
||||||
scanner := &day2Scanner{scanner: ctx.Scanner(aocutils.SplitComma), sep: '-'}
|
scanner := &day2Scanner{scanner: ctx.Scanner(aoc.SplitComma), sep: '-'}
|
||||||
|
|
||||||
var sum int
|
var sum int
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
|
|||||||
@ -9,13 +9,13 @@ import (
|
|||||||
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/aocutils"
|
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/aocutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Day3Part1(ctx aocutils.Context) (any, error) {
|
func Day3Part1(ctx aoc.Context) (any, error) {
|
||||||
return Day3(ctx, 2)
|
return Day3(ctx, 2)
|
||||||
}
|
}
|
||||||
func Day3Part2(ctx aocutils.Context) (any, error) {
|
func Day3Part2(ctx aoc.Context) (any, error) {
|
||||||
return Day3(ctx, 12)
|
return Day3(ctx, 12)
|
||||||
}
|
}
|
||||||
func Day3(ctx aocutils.Context, size int) (int64, error) {
|
func Day3(ctx aoc.Context, size int) (int64, error) {
|
||||||
scanner := ctx.Scanner(bufio.ScanLines)
|
scanner := ctx.Scanner(bufio.ScanLines)
|
||||||
var sum int64
|
var sum int64
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
const Day4PaperRoll = '@'
|
const Day4PaperRoll = '@'
|
||||||
|
|
||||||
func Day4Part1(ctx aocutils.Context) (any, error) {
|
func Day4Part1(ctx aoc.Context) (any, error) {
|
||||||
// 4 rolls in 8 adjacent positions
|
// 4 rolls in 8 adjacent positions
|
||||||
const maxAdjacentRolls = 4
|
const maxAdjacentRolls = 4
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ func Day4Part1(ctx aocutils.Context) (any, error) {
|
|||||||
return accessibleRolls, nil
|
return accessibleRolls, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day4Part2(ctx aocutils.Context) (any, error) {
|
func Day4Part2(ctx aoc.Context) (any, error) {
|
||||||
// 4 rolls in 8 adjacent positions
|
// 4 rolls in 8 adjacent positions
|
||||||
const maxAdjacentRolls = 4
|
const maxAdjacentRolls = 4
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package year25
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"cmp"
|
||||||
"fmt"
|
"fmt"
|
||||||
"iter"
|
"iter"
|
||||||
"slices"
|
"slices"
|
||||||
@ -20,7 +21,7 @@ type MergedIntervals struct {
|
|||||||
intervals []*Day5Interval
|
intervals []*Day5Interval
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MergedIntervals) Put(newInterval Day5Interval) {
|
func (m *MergedIntervals) Put1(newInterval Day5Interval) {
|
||||||
for item := range m.Items() {
|
for item := range m.Items() {
|
||||||
if newInterval.Start <= item.End && newInterval.End >= item.Start {
|
if newInterval.Start <= item.End && newInterval.End >= item.Start {
|
||||||
newInterval.Start = min(newInterval.Start, item.Start)
|
newInterval.Start = min(newInterval.Start, item.Start)
|
||||||
@ -39,7 +40,7 @@ func (m *MergedIntervals) Put(newInterval Day5Interval) {
|
|||||||
|
|
||||||
m.intervals = append(m.intervals, &newInterval)
|
m.intervals = append(m.intervals, &newInterval)
|
||||||
}
|
}
|
||||||
func (m *MergedIntervals) Put2(newInterval Day5Interval) {
|
func (m *MergedIntervals) Put(newInterval Day5Interval) {
|
||||||
// fast search start, end
|
// fast search start, end
|
||||||
for item := range m.Items() {
|
for item := range m.Items() {
|
||||||
if newInterval.Start <= item.End && newInterval.End >= item.Start {
|
if newInterval.Start <= item.End && newInterval.End >= item.Start {
|
||||||
@ -52,8 +53,14 @@ func (m *MergedIntervals) Put2(newInterval Day5Interval) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert in order
|
m.intervals = slices.DeleteFunc(m.intervals, func(i *Day5Interval) bool {
|
||||||
m.intervals = append(m.intervals, &newInterval)
|
return i.isRemoved
|
||||||
|
})
|
||||||
|
|
||||||
|
i, _ := slices.BinarySearchFunc(m.intervals, &newInterval, func(interval *Day5Interval, d *Day5Interval) int {
|
||||||
|
return cmp.Compare(interval.Start, newInterval.Start)
|
||||||
|
})
|
||||||
|
m.intervals = slices.Insert(m.intervals, i, &newInterval)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MergedIntervals) CheckItem(itemId int64) (*Day5Interval, bool) {
|
func (m *MergedIntervals) CheckItem(itemId int64) (*Day5Interval, bool) {
|
||||||
@ -102,7 +109,7 @@ func Day5ParseIntervals(s *bufio.Scanner) (intervals *MergedIntervals, err error
|
|||||||
return intervals, s.Err()
|
return intervals, s.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day5Part1(ctx aocutils.Context) (int, error) {
|
func Day5Part1(ctx aoc.Context) (int, error) {
|
||||||
scanner := ctx.Scanner()
|
scanner := ctx.Scanner()
|
||||||
intervals, err := Day5ParseIntervals(scanner)
|
intervals, err := Day5ParseIntervals(scanner)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -126,7 +133,7 @@ func Day5Part1(ctx aocutils.Context) (int, error) {
|
|||||||
return freshIngredients, scanner.Err()
|
return freshIngredients, scanner.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
func Day5Part2(ctx aocutils.Context) (solution int64, _ error) {
|
func Day5Part2(ctx aoc.Context) (solution int64, _ error) {
|
||||||
intervals, err := Day5ParseIntervals(ctx.Scanner())
|
intervals, err := Day5ParseIntervals(ctx.Scanner())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("day5: failed to parse intervals %w", err)
|
return 0, fmt.Errorf("day5: failed to parse intervals %w", err)
|
||||||
|
|||||||
150
year25/day6.go
Normal file
150
year25/day6.go
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
package year25
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/aocutils"
|
||||||
|
"git.bizdoc.ro/private/devkit.git/collections/geometry/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Day6Part1(c aoc.Context) (int64, error) {
|
||||||
|
c.Logger = log.New(os.Stdout, "", log.LstdFlags)
|
||||||
|
lines, tokens, err := day6ParseInputs(c)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("error parsing inputs: %w", err)
|
||||||
|
}
|
||||||
|
var total int64
|
||||||
|
for _, t := range tokens {
|
||||||
|
calc := day6NewCalc(t.Operation)
|
||||||
|
|
||||||
|
for _, line := range lines {
|
||||||
|
valueStr := string(line[t.Start:t.End()])
|
||||||
|
v, err := strconv.Atoi(strings.TrimSpace(valueStr))
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("converting %s to int: %w", valueStr, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Printf("'%s' ", valueStr)
|
||||||
|
calc.Put(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Printf("'%s' %d\n", string(t.Operation), calc.Value)
|
||||||
|
total += int64(calc.Value)
|
||||||
|
}
|
||||||
|
return total, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Day6Part2(c aoc.Context) (int64, error) {
|
||||||
|
lines, tokens, err := day6ParseInputs(c)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("error parsing inputs: %w", err)
|
||||||
|
}
|
||||||
|
var total int64
|
||||||
|
for _, t := range tokens {
|
||||||
|
calc := day6NewCalc(t.Operation)
|
||||||
|
|
||||||
|
mask := geometry.NewGrid[byte](t.Size, len(lines)).Data()
|
||||||
|
for i := range mask {
|
||||||
|
for j := range mask[i] {
|
||||||
|
mask[i][j] = lines[j][t.Start+i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, line := range mask {
|
||||||
|
v, err := strconv.Atoi(strings.TrimSpace(string(line)))
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("converting %s to int: %w", string(line), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Printf("'%s' ", string(line))
|
||||||
|
calc.Put(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Printf("'%s' %d\n", string(t.Operation), calc.Value)
|
||||||
|
total += int64(calc.Value)
|
||||||
|
}
|
||||||
|
return total, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type day6Calc[T any] struct {
|
||||||
|
Value T
|
||||||
|
handler func(a T, b T) T
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *day6Calc[T]) Put(v T) {
|
||||||
|
d.Value = d.handler(d.Value, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
func day6NewCalc(sign byte) day6Calc[int] {
|
||||||
|
switch sign {
|
||||||
|
case '+':
|
||||||
|
return day6Calc[int]{
|
||||||
|
Value: 0,
|
||||||
|
handler: func(a int, b int) int {
|
||||||
|
return a + b
|
||||||
|
},
|
||||||
|
}
|
||||||
|
case '*':
|
||||||
|
return day6Calc[int]{
|
||||||
|
Value: 1,
|
||||||
|
handler: func(a int, b int) int {
|
||||||
|
return a * b
|
||||||
|
},
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("day6NewCalc: invalid sign %v", sign))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type day6Token struct {
|
||||||
|
Start, Size int
|
||||||
|
Operation byte
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t day6Token) End() int {
|
||||||
|
return t.Start + t.Size
|
||||||
|
}
|
||||||
|
|
||||||
|
func day6ParseInputs(c aoc.Context) (lines [][]byte, tokens []day6Token, err error) {
|
||||||
|
s := c.Scanner()
|
||||||
|
|
||||||
|
// handle malformed input
|
||||||
|
var maxLineSize int
|
||||||
|
for i := 0; s.Scan(); i++ {
|
||||||
|
line := bytes.Clone(s.Bytes())
|
||||||
|
maxLineSize = max(maxLineSize, len(line))
|
||||||
|
lines = append(lines, line)
|
||||||
|
}
|
||||||
|
if err := s.Err(); err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("error scanning input")
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := range lines {
|
||||||
|
if len(lines[i]) < maxLineSize {
|
||||||
|
lines[i] = append(lines[i], strings.Repeat(" ", maxLineSize-len(lines[i]))...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
opLine := lines[len(lines)-1]
|
||||||
|
for i := bytes.IndexAny(opLine, "+*"); i < maxLineSize; i++ {
|
||||||
|
tokenLen := bytes.IndexAny(opLine[i+1:], "+*")
|
||||||
|
if tokenLen == -1 {
|
||||||
|
tokenLen = maxLineSize - i
|
||||||
|
}
|
||||||
|
|
||||||
|
tokens = append(tokens, day6Token{
|
||||||
|
Start: i,
|
||||||
|
Size: tokenLen,
|
||||||
|
Operation: opLine[i],
|
||||||
|
})
|
||||||
|
|
||||||
|
i += tokenLen
|
||||||
|
}
|
||||||
|
|
||||||
|
return lines[:len(lines)-1], tokens, nil
|
||||||
|
}
|
||||||
91
year25/day7.go
Normal file
91
year25/day7.go
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
package year25
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/aocutils"
|
||||||
|
"git.bizdoc.ro/gabi-public/Advent-of-Code.git/year25/day7_pg"
|
||||||
|
"git.bizdoc.ro/private/devkit.git/collections/geometry/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func day7ParseInput(c aoc.Context) (g geometry.Grid[byte], start geometry.Point, _ error) {
|
||||||
|
g, err := geometry.ReaderToByteGrid(c.Body)
|
||||||
|
if err != nil {
|
||||||
|
return g, start, fmt.Errorf("day7: failed to read input %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
findStart := g.Find(func(b byte) bool {
|
||||||
|
return b == byte('S')
|
||||||
|
})
|
||||||
|
|
||||||
|
for start = range findStart {
|
||||||
|
return g, start, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return g, start, fmt.Errorf("day7: failed to find start point")
|
||||||
|
}
|
||||||
|
|
||||||
|
func Day7Part1(c aoc.Context) (int, error) {
|
||||||
|
g, start, err := day7ParseInput(c)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("day7: failed to parse input %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var fill func(g geometry.Grid[byte], start geometry.Point) int
|
||||||
|
fill = func(g geometry.Grid[byte], start geometry.Point) int {
|
||||||
|
if g.ContainsPoint(start) {
|
||||||
|
switch g.At(start) {
|
||||||
|
case 'S':
|
||||||
|
return fill(g, start.MoveDown())
|
||||||
|
case '.':
|
||||||
|
g.Set(start, '|')
|
||||||
|
return fill(g, start.MoveDown())
|
||||||
|
case '^':
|
||||||
|
return 1 + fill(g, start.MoveLeft()) + fill(g, start.MoveRight())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return fill(g, start), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Day7Part2(c aoc.Context) (int, error) {
|
||||||
|
g, start, err := day7ParseInput(c)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("day7: failed to parse input %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
h := geometry.NewGrid[int](g.Rows(), g.Cols())
|
||||||
|
|
||||||
|
var fill func(g geometry.Grid[byte], h geometry.Grid[int], start geometry.Point) int
|
||||||
|
fill = func(g geometry.Grid[byte], cache geometry.Grid[int], start geometry.Point) int {
|
||||||
|
if g.ContainsPoint(start) {
|
||||||
|
switch g.At(start) {
|
||||||
|
case 'S':
|
||||||
|
return 1 + fill(g, cache, start.MoveDown())
|
||||||
|
case '.':
|
||||||
|
g.Set(start, '|')
|
||||||
|
v := fill(g, cache, start.MoveDown())
|
||||||
|
cache.Set(start, v)
|
||||||
|
return v
|
||||||
|
case '|':
|
||||||
|
return cache.At(start) // cached value
|
||||||
|
case '^':
|
||||||
|
return 1 + fill(g, cache, start.MoveLeft()) + fill(g, cache, start.MoveRight())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return fill(g, h, start), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Day7Part1Render(c aoc.Context) (int, error) {
|
||||||
|
g, start, err := day7ParseInput(c)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("day7: failed to parse input %w", err)
|
||||||
|
}
|
||||||
|
var ev day7_pg.Day7Part1RenderEvent
|
||||||
|
for ev = range day7_pg.Day7ProgressFillPart1(g, start) {
|
||||||
|
}
|
||||||
|
return int(ev.TotalProcessed), nil
|
||||||
|
}
|
||||||
48
year25/day7_pg/stack.go
Normal file
48
year25/day7_pg/stack.go
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package day7_pg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"iter"
|
||||||
|
|
||||||
|
"git.bizdoc.ro/private/devkit.git/collections/dsa"
|
||||||
|
"git.bizdoc.ro/private/devkit.git/collections/geometry/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Day7Part1RenderEvent struct {
|
||||||
|
Point geometry.Point
|
||||||
|
Grid geometry.Grid[byte]
|
||||||
|
TotalProcessed int64
|
||||||
|
Step int
|
||||||
|
}
|
||||||
|
|
||||||
|
func Day7ProgressFillPart1(g geometry.Grid[byte], start geometry.Point) iter.Seq[Day7Part1RenderEvent] {
|
||||||
|
return func(yield func(Day7Part1RenderEvent) bool) {
|
||||||
|
stack := dsa.NewStack[geometry.Point]()
|
||||||
|
stack.Push(start)
|
||||||
|
|
||||||
|
ev := Day7Part1RenderEvent{
|
||||||
|
Point: start,
|
||||||
|
Grid: g,
|
||||||
|
TotalProcessed: 0,
|
||||||
|
}
|
||||||
|
for !stack.IsEmpty() {
|
||||||
|
start := stack.Pop()
|
||||||
|
if g.ContainsPoint(start) {
|
||||||
|
switch g.At(start) {
|
||||||
|
case 'S':
|
||||||
|
stack.Push(start.MoveDown())
|
||||||
|
case '.':
|
||||||
|
g.Set(start, '|')
|
||||||
|
stack.Push(start.MoveDown())
|
||||||
|
case '^':
|
||||||
|
stack.Push(start.MoveRight())
|
||||||
|
stack.Push(start.MoveLeft())
|
||||||
|
ev.TotalProcessed += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ev.Step += 1
|
||||||
|
if !yield(ev) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user