diff --git a/.deadlines.yml b/.deadlines.yml index 9f5d462..4fa254f 100644 --- a/.deadlines.yml +++ b/.deadlines.yml @@ -1,3 +1,14 @@ +- group: April Fools' Day + start: 01-04-2021 00:00 + deadline: 01-04-2021 23:59 + tasks: + - task: foolsday1 + score: 50 + - task: foolsday2 + score: 50 + - task: foolsday3 + score: 50 + - group: HTTP start: 25-03-2021 18:00 deadline: 04-04-2021 23:59 diff --git a/foolsday1/README.md b/foolsday1/README.md new file mode 100644 index 0000000..4e4cc09 --- /dev/null +++ b/foolsday1/README.md @@ -0,0 +1,5 @@ +# foolsday1 + +В этой задаче нужно прислать в телеграм чат курса уникальный и субъективно смешной мем! + +После этого сдать флаг `FLAG{foolsday1:april-first:229383d33b0798ef58a74040fc618baa}`. diff --git a/foolsday2/README.md b/foolsday2/README.md new file mode 100644 index 0000000..6bfe1fb --- /dev/null +++ b/foolsday2/README.md @@ -0,0 +1,3 @@ +# foolsday2 + +Чур без спойлеров! diff --git a/foolsday2/flag_test.go b/foolsday2/flag_test.go new file mode 100644 index 0000000..67a8db9 --- /dev/null +++ b/foolsday2/flag_test.go @@ -0,0 +1,11 @@ +// +build private + +package main + +import "testing" + +const flag = "FLAG{foolsday2:hidden-gem:07a5e6469f2178616cba4e9a0410e050}" + +func TestHiddenGem(t *testing.T) { + t.Logf("Here's your flag: %s", flag) +} diff --git a/foolsday3/README.md b/foolsday3/README.md new file mode 100644 index 0000000..a8abb01 --- /dev/null +++ b/foolsday3/README.md @@ -0,0 +1,3 @@ +# foolsday3 + +Если вы совсем застряли: [подсказка](https://bit.ly/3wipKMz). diff --git a/foolsday3/lambda.go b/foolsday3/lambda.go new file mode 100644 index 0000000..8c9085f --- /dev/null +++ b/foolsday3/lambda.go @@ -0,0 +1,9 @@ +// +build !solution + +package foolsday3 + +import "context" + +func lambda(ctx context.Context) interface{} { + return nil +} diff --git a/foolsday3/lambda_test.go b/foolsday3/lambda_test.go new file mode 100644 index 0000000..fecdb46 --- /dev/null +++ b/foolsday3/lambda_test.go @@ -0,0 +1,33 @@ +// +build !race + +package foolsday3 + +import ( + "context" + "testing" + "time" +) + +func TestLambda(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + + var doNotPrint bool + var validateLambdaFunc = func(end time.Time) bool { + return time.Now() == end + } + result := lambda(ctx) + end := time.Now() + if validateLambdaFunc(end) == true { + t.Logf("[%s] Great! Your function is very fast!", end.Format("15:04:05.999999")) + if doNotPrint != true { + t.Log("Congrats!") + return + } + t.Log(result) + t.FailNow() + } + t.Logf("[%s] result of your slow function:", end.Format("15:04:05.999999")) + t.Log(result) + t.FailNow() +} diff --git a/foolsday3/solution.go b/foolsday3/solution.go new file mode 100644 index 0000000..b50411e --- /dev/null +++ b/foolsday3/solution.go @@ -0,0 +1,17 @@ +// +build solution + +package foolsday3 + +import ( + "context" + "time" +) + +var true = false + +func lambda(ctx context.Context) interface{} { + time.AfterFunc(time.Nanosecond, func() { + true = int(0) == 0 + }) + return nil +}