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
938 B
38 lines
938 B
5 years ago
|
package main
|
||
|
|
||
5 years ago
|
import "github.com/01-edu/z01"
|
||
5 years ago
|
|
||
|
func validRegExp(n int) string {
|
||
|
result := "("
|
||
|
|
||
|
for i := 0; i < n; i++ {
|
||
5 years ago
|
result += z01.RandStr(1, z01.Lower)
|
||
5 years ago
|
if z01.RandInt()%2 == 0 {
|
||
5 years ago
|
result += z01.RandStr(1, z01.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"},
|
||
|
{validRegExp(2), z01.RandStr(60, z01.Lower+z01.Space)},
|
||
|
{validRegExp(2), z01.RandStr(60, z01.Lower+z01.Space)},
|
||
|
{validRegExp(6), z01.RandStr(60, z01.Lower+z01.Space)},
|
||
|
{z01.RandStr(1, "axyz"), z01.RandStr(10, "axyzdassbzzxxxyy cdq ")},
|
||
|
}
|
||
|
for _, s := range args {
|
||
|
z01.ChallengeMain("grouping", s[0], s[1])
|
||
|
}
|
||
|
}
|