|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
student "student"
|
|
|
|
|
|
|
|
"base"
|
|
|
|
"lib"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
type node struct {
|
|
|
|
s string
|
|
|
|
base string
|
|
|
|
}
|
|
|
|
|
|
|
|
table := []node{}
|
|
|
|
|
|
|
|
// 15 random pairs of string numbers with valid bases
|
|
|
|
for i := 0; i < 15; 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
|
|
|
validBaseToInput := base.Valid()
|
|
|
|
val := node{
|
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
|
|
|
s: base.StringFrom(validBaseToInput),
|
|
|
|
base: validBaseToInput,
|
|
|
|
}
|
|
|
|
table = append(table, val)
|
|
|
|
}
|
|
|
|
// 15 random pairs of string numbers with invalid bases
|
|
|
|
for i := 0; i < 15; 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
|
|
|
invalidBaseToInput := base.Invalid()
|
|
|
|
val := node{
|
|
|
|
s: "thisinputshouldnotmatter",
|
|
|
|
base: invalidBaseToInput,
|
|
|
|
}
|
|
|
|
table = append(table, val)
|
|
|
|
}
|
|
|
|
table = append(table,
|
|
|
|
node{s: "125", base: "0123456789"},
|
|
|
|
node{s: "1111101", base: "01"},
|
|
|
|
node{s: "7D", base: "0123456789ABCDEF"},
|
|
|
|
node{s: "uoi", base: "choumi"},
|
|
|
|
node{s: "bbbbbab", base: "-ab"},
|
|
|
|
)
|
|
|
|
for _, arg := range table {
|
|
|
|
lib.Challenge("AtoiBase", student.AtoiBase, base.Atoi, arg.s, arg.base)
|
|
|
|
}
|
|
|
|
}
|