aboutsummaryrefslogtreecommitdiff
path: root/tris/core.go
diff options
context:
space:
mode:
Diffstat (limited to 'tris/core.go')
-rw-r--r--tris/core.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/tris/core.go b/tris/core.go
index af46311..0b5afff 100644
--- a/tris/core.go
+++ b/tris/core.go
@@ -44,19 +44,10 @@ type Placement struct {
Lock time.Time
}
-func (p Placement) Drop(f Field) (Placement, bool) {
- newp := p
- newp.Y++
- if !newp.Collide(f) {
- return newp, true
- }
- return p, false
-}
-
func (p Placement) Collide(f Field) bool { //TODO: Fix first piece collision bug
pf, ok := p.Field()
for x := 0; x < 9; x++ {
- for y := 0; y < 19; y++ {
+ for y := 0; y < 20; y++ {
if f[y][x] && pf[y][x] {
return true
}
@@ -130,6 +121,7 @@ func (f Field) Add(p Placement) Field {
fn[point.Y][point.X] = true
}
return fn
+
}
func (f Field) String() (output string) {