aboutsummaryrefslogtreecommitdiff
path: root/tris/next.go
blob: e72a4fffef6887f2a60199ded0109d1b710ff3d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package tris

func (b Bag) Next(n int) (Bag, Field) {
	var f Field
	for len(b) < n {
		b = append(b, NewBag()...)
	}
	nextpieces := b[:n]
	for i, p := range nextpieces {
		f = f.Add(Placement{piece: p, Y:2+i*4})
	}
	return b, f
}