aboutsummaryrefslogtreecommitdiff
path: root/tris/next.go
diff options
context:
space:
mode:
Diffstat (limited to 'tris/next.go')
-rw-r--r--tris/next.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/tris/next.go b/tris/next.go
new file mode 100644
index 0000000..e72a4ff
--- /dev/null
+++ b/tris/next.go
@@ -0,0 +1,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
+}