2017-03-27 15:07:29 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-02-14 14:57:02 -06:00
|
|
|
"math/rand"
|
2017-03-27 15:07:29 -05:00
|
|
|
"os"
|
|
|
|
"path/filepath"
|
2018-02-14 14:57:02 -06:00
|
|
|
"time"
|
2017-03-27 15:07:29 -05:00
|
|
|
|
2018-02-14 14:57:02 -06:00
|
|
|
"gopkg.in/inconshreveable/log15.v2"
|
2017-03-27 15:07:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
baseDir, _ = filepath.Abs(filepath.Dir(os.Args[0]))
|
|
|
|
logger = log15.New()
|
|
|
|
if baseDir != "" {
|
|
|
|
logger.SetHandler(log15.Must.FileHandler(baseDir+"/tetris.log", log15.LogfmtFormat()))
|
|
|
|
}
|
|
|
|
|
2018-02-14 14:57:02 -06:00
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
|
|
|
|
NewMinos()
|
|
|
|
NewBoard()
|
|
|
|
NewView()
|
|
|
|
NewEngine()
|
2017-03-27 15:07:29 -05:00
|
|
|
|
|
|
|
engine.Run()
|
|
|
|
|
|
|
|
view.Stop()
|
|
|
|
|
|
|
|
}
|