|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"../lib"
|
|
|
|
"./correct"
|
|
|
|
"./student"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// testing examples of subjects
|
|
|
|
table := []int{
|
|
|
|
5, 3,
|
|
|
|
5, 1,
|
|
|
|
1, 1,
|
|
|
|
1, 5,
|
|
|
|
}
|
|
|
|
|
|
|
|
// testing special cases and one valid random case.
|
|
|
|
table = append(table,
|
|
|
|
0, 0,
|
|
|
|
-1, 6,
|
|
|
|
6, -1,
|
|
|
|
lib.RandIntBetween(1, 20), lib.RandIntBetween(1, 20),
|
|
|
|
)
|
|
|
|
|
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
|
|
|
// Tests all possibilities including 0 0, -x y, x -y
|
|
|
|
for i := 0; i < len(table); i += 2 {
|
|
|
|
if i != len(table)-1 {
|
|
|
|
lib.Challenge("Raid1a", correct.Raid1a, student.Raid1a, table[i], table[i+1])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|