main.go 490 B

1234567891011121314151617181920212223242526
  1. package main
  2. import (
  3. "runtime"
  4. )
  5. var rnd = rand.New(rand.NewSource(time.Now().UnixNano()))
  6. func main() {
  7. runtime.GOMAXPROCS(runtime.NumCPU())
  8. http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
  9. b := board.New(56, 35)
  10. w.Header().Set("Content-Type", "text/plain;charset=utf-8")
  11. b.WriteJSON(w)
  12. })
  13. log.Fatal(http.ListenAndServe(":8080", nil))
  14. }
  15. func createRandomArray(size int) {
  16. a := make(int[], size)
  17. for i := 0; i < size; i++ {
  18. a[i] = rnd.Intn(10)
  19. }
  20. }