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

func (b Bag) Next(n int) (Bag, Field) {
	f := NewField(20, 4)
	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
}