9fans.net/go@v0.0.5/games/4s/4s.go (about)

     1  // Copyright 2009 The Go Authors.  All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // 4s is a tetromino stacking game.
     6  // Use 4s -5 for pentominoes.
     7  package main // import "9fans.net/go/games/4s"
     8  
     9  import (
    10  	"log"
    11  	"os"
    12  
    13  	"9fans.net/go/draw"
    14  )
    15  
    16  func main() {
    17  	args := os.Args
    18  	p := pieces4
    19  	name := "4s"
    20  	if len(args) > 1 && args[1] == "-5" {
    21  		p = pieces5
    22  		name = "5s"
    23  	}
    24  
    25  	d, err := draw.Init(nil, "", name, "")
    26  	if err != nil {
    27  		log.Fatal(err)
    28  	}
    29  
    30  	Play(p, d)
    31  }