-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
67 lines (56 loc) · 1.64 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package main
import (
"errors"
"fmt"
)
var (
// ErrNameNotProvided is thrown when a name is not provided
ErrNameNotProvided = errors.New("no name was provided in the HTTP body")
)
// Handler is your Lambda function handler
// It uses Amazon API Gateway request/responses provided by the aws-lambda-go/events package,
// However you could use other event sources (S3, Kinesis etc), or JSON-decoded primitive types such as 'string'.
// func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
// // stdout and stderr are sent to AWS CloudWatch Logs
// log.Printf("Processing Lambda request %s\n", request.RequestContext.RequestID)
// // If no name is provided in the HTTP request body, throw an error
// if len(request.Body) < 1 {
// return events.APIGatewayProxyResponse{}, ErrNameNotProvided
// }
// return events.APIGatewayProxyResponse{
// Body: "Hello " + request.Body,
// StatusCode: 200,
// }, nil
// }
func main() {
// Arrange
// decklist := map[string]int{
// "Volcanic Island": 4,
// "Tundra": 4,
// "Flooded Strand": 4,
// "Scalding Tarn": 4,
// "Mountain": 1,
// "Plain": 1,
// "Island": 3,
// "Blah": 39,
// }
decklist := map[string]int{
"Volcanic Island": 4,
"Tundra": 4,
"Flooded Strand": 4,
"Scalding Tarn": 4,
"Mountain": 1,
"Plain": 1,
"Island": 3,
"Blah": 39,
}
ti := engine{
ps: exaustiveStrat{},
as: nil,
}
testlist := Shuffle(decklist)
fmt.Println(testlist)
result := ti.PlayPermutations(testlist, 8)
// Assert
fmt.Printf("%+v\n", result)
}