|
|
|
package main
|
|
|
|
|
|
|
|
import "../lib"
|
|
|
|
|
|
|
|
func validRegExp(n int) string {
|
|
|
|
result := "("
|
|
|
|
|
|
|
|
for i := 0; i < n; i++ {
|
|
|
|
result += lib.RandStr(1, lib.Lower)
|
|
|
|
if lib.RandInt()%2 == 0 {
|
|
|
|
result += lib.RandStr(1, lib.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), 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 ")},
|
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
|
|
|
}
|
|
|
|
for _, s := range args {
|
|
|
|
lib.ChallengeMain("grouping", s[0], s[1])
|
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
|
|
|
}
|
|
|
|
}
|