mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
923 B
38 lines
923 B
5 years ago
|
package main
|
||
|
|
||
5 years ago
|
import "../lib"
|
||
5 years ago
|
|
||
|
func validRegExp(n int) string {
|
||
|
result := "("
|
||
|
|
||
|
for i := 0; i < n; i++ {
|
||
5 years ago
|
result += lib.RandStr(1, lib.Lower)
|
||
|
if lib.RandInt()%2 == 0 {
|
||
|
result += lib.RandStr(1, lib.Lower)
|
||
5 years ago
|
}
|
||
|
if i != n-1 {
|
||
|
result += "|"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
result += ")"
|
||
|
return result
|
||
|
}
|
||
5 years ago
|
|
||
|
func main() {
|
||
|
args := [][2]string{
|
||
|
{"(a)", "I'm heavyjumpsuit is on steady, Lighter when I'm lower, higher when I'm heavy"},
|
||
|
{"(e|n)", "I currently have 4 windows opened up… and I don’t know why."},
|
||
|
{"(hi)", "He swore he just saw his sushi move."},
|
||
|
{"(s)", ""},
|
||
|
{"i", "Something in the air"},
|
||
5 years ago
|
{validRegExp(2), lib.RandStr(60, lib.Lower+lib.Space)},
|
||
|
{validRegExp(2), lib.RandStr(60, lib.Lower+lib.Space)},
|
||
|
{validRegExp(6), lib.RandStr(60, lib.Lower+lib.Space)},
|
||
|
{lib.RandStr(1, "axyz"), lib.RandStr(10, "axyzdassbzzxxxyy cdq ")},
|
||
5 years ago
|
}
|
||
|
for _, s := range args {
|
||
5 years ago
|
lib.ChallengeMain("grouping", s[0], s[1])
|
||
5 years ago
|
}
|
||
|
}
|