|
|
|
package main
|
|
|
|
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
import "github.com/01-edu/z01"
|
|
|
|
|
|
|
|
func validRegExp(n int) string {
|
|
|
|
result := "("
|
|
|
|
|
|
|
|
for i := 0; i < n; i++ {
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
result += z01.RandStr(1, z01.Lower)
|
|
|
|
if z01.RandInt()%2 == 0 {
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
result += z01.RandStr(1, z01.Lower)
|
|
|
|
}
|
|
|
|
if i != n-1 {
|
|
|
|
result += "|"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
result += ")"
|
|
|
|
return result
|
|
|
|
}
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
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])
|
|
|
|
}
|
|
|
|
}
|