|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
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
|
|
|
"github.com/01-edu/z01"
|
|
|
|
|
|
|
|
solutions "./solutions"
|
|
|
|
student "./student"
|
|
|
|
)
|
|
|
|
|
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 stringsToTrimAtoi(a []string) []string {
|
|
|
|
alpha := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789012345678901234567890123456789"
|
|
|
|
|
|
|
|
for index := 0; index < 4; index++ {
|
|
|
|
s := ""
|
|
|
|
s += z01.RandStr(z01.RandIntBetween(0, 2), alpha)
|
|
|
|
x := z01.RandIntBetween(0, 14)
|
|
|
|
if x <= 4 {
|
|
|
|
s += "-"
|
|
|
|
}
|
|
|
|
s += z01.RandStr(z01.RandIntBetween(0, 10), alpha)
|
|
|
|
a = append(a, s)
|
|
|
|
}
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
|
|
|
func 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
|
|
|
a := []string{
|
|
|
|
"",
|
|
|
|
"12345",
|
|
|
|
"str123ing45",
|
|
|
|
"012 345",
|
|
|
|
"Hello World!",
|
|
|
|
"sd+x1fa2W3s4",
|
|
|
|
"sd-x1fa2W3s4",
|
|
|
|
"sdx1-fa2W3s4",
|
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
|
|
|
z01.RandAlnum(),
|
|
|
|
}
|
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
|
|
|
a = stringsToTrimAtoi(a)
|
|
|
|
for _, elem := range a {
|
|
|
|
z01.Challenge("TrimAtoi", student.TrimAtoi, solutions.TrimAtoi, elem)
|
|
|
|
}
|
|
|
|
}
|