mirror of https://github.com/01-edu/public.git
Xavier Petit
4 years ago
committed by
xpetit
207 changed files with 1154 additions and 1287 deletions
@ -1,18 +1,17 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
arg := z01.MultRandInt() |
||||
arg = append(arg, z01.RandInt()) |
||||
arg := lib.MultRandInt() |
||||
arg = append(arg, lib.RandInt()) |
||||
for i := 0; i < 15; i++ { |
||||
z01.Challenge("Abort", student.Abort, correct.Abort, arg[0], arg[1], arg[2], arg[3], arg[4]) |
||||
arg = z01.MultRandInt() |
||||
arg = append(arg, z01.RandInt()) |
||||
lib.Challenge("Abort", student.Abort, correct.Abort, arg[0], arg[1], arg[2], arg[3], arg[4]) |
||||
arg = lib.MultRandInt() |
||||
arg = append(arg, lib.RandInt()) |
||||
} |
||||
} |
||||
|
@ -1,18 +1,17 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
args := []int{z01.RandIntBetween(2, 20)} |
||||
args = append(args, z01.MultRandIntBetween(2, 20)...) |
||||
args = append(args, z01.MultRandIntBetween(2, 20)...) |
||||
args := []int{lib.RandIntBetween(2, 20)} |
||||
args = append(args, lib.MultRandIntBetween(2, 20)...) |
||||
args = append(args, lib.MultRandIntBetween(2, 20)...) |
||||
|
||||
for _, v := range args { |
||||
z01.Challenge("ActiveBits", student.ActiveBits, correct.ActiveBits, v) |
||||
lib.Challenge("ActiveBits", student.ActiveBits, correct.ActiveBits, v) |
||||
} |
||||
} |
||||
|
@ -1,20 +1,19 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
args := []int{z01.RandIntBetween(-6, 20)} |
||||
args := []int{lib.RandIntBetween(-6, 20)} |
||||
args = append(args, -5, 0) |
||||
for i := 0; i < 20; i++ { |
||||
args = append(args, z01.RandIntBetween(2, 20)) |
||||
args = append(args, lib.RandIntBetween(2, 20)) |
||||
} |
||||
|
||||
for _, v := range args { |
||||
z01.Challenge("CollatzCountdown", student.CollatzCountdown, correct.CollatzCountdown, v) |
||||
lib.Challenge("CollatzCountdown", student.CollatzCountdown, correct.CollatzCountdown, v) |
||||
} |
||||
} |
||||
|
@ -1,12 +1,11 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
z01.Challenge("EightQueens", student.EightQueens, correct.EightQueens) |
||||
lib.Challenge("EightQueens", student.EightQueens, correct.EightQueens) |
||||
} |
||||
|
@ -1,20 +1,19 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := append( |
||||
z01.MultRandIntBetween(0, 25), |
||||
lib.MultRandIntBetween(0, 25), |
||||
4, |
||||
5, |
||||
-5, |
||||
) |
||||
for _, arg := range table { |
||||
z01.Challenge("Fibonacci", student.Fibonacci, correct.Fibonacci, arg) |
||||
lib.Challenge("Fibonacci", student.Fibonacci, correct.Fibonacci, arg) |
||||
} |
||||
} |
||||
|
@ -1,15 +1,14 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
a := append(z01.MultRandIntBetween(0, 99999), 5, 4, 1) |
||||
a := append(lib.MultRandIntBetween(0, 99999), 5, 4, 1) |
||||
for _, elem := range a { |
||||
z01.Challenge("FindPrevPrime", student.FindPrevPrime, correct.FindPrevPrime, elem) |
||||
lib.Challenge("FindPrevPrime", student.FindPrevPrime, correct.FindPrevPrime, elem) |
||||
} |
||||
} |
||||
|
@ -1,21 +1,20 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := append( |
||||
z01.MultRandASCII(), |
||||
lib.MultRandASCII(), |
||||
"Hello!", |
||||
"Salut!", |
||||
"Ola!", |
||||
"♥01", |
||||
) |
||||
for _, arg := range table { |
||||
z01.Challenge("FirstRune", student.FirstRune, correct.FirstRune, arg) |
||||
lib.Challenge("FirstRune", student.FirstRune, correct.FirstRune, arg) |
||||
} |
||||
} |
||||
|
@ -1,20 +1,19 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := append( |
||||
z01.MultRandInt(), |
||||
z01.MinInt, |
||||
z01.MaxInt, |
||||
lib.MultRandInt(), |
||||
lib.MinInt, |
||||
lib.MaxInt, |
||||
0, |
||||
) |
||||
for _, arg := range table { |
||||
z01.Challenge("IsNegative", student.IsNegative, correct.IsNegative, arg) |
||||
lib.Challenge("IsNegative", student.IsNegative, correct.IsNegative, arg) |
||||
} |
||||
} |
||||
|
@ -1,20 +1,19 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
i := 0 |
||||
for i < 30 { |
||||
nb := z01.RandIntBetween(-8, 8) |
||||
power := z01.RandIntBetween(-10, 10) |
||||
z01.Challenge("IterativePower", student.IterativePower, correct.IterativePower, nb, power) |
||||
nb := lib.RandIntBetween(-8, 8) |
||||
power := lib.RandIntBetween(-10, 10) |
||||
lib.Challenge("IterativePower", student.IterativePower, correct.IterativePower, nb, power) |
||||
i++ |
||||
} |
||||
z01.Challenge("IterativePower", student.IterativePower, correct.IterativePower, 0, 0) |
||||
z01.Challenge("IterativePower", student.IterativePower, correct.IterativePower, 0, 1) |
||||
lib.Challenge("IterativePower", student.IterativePower, correct.IterativePower, 0, 0) |
||||
lib.Challenge("IterativePower", student.IterativePower, correct.IterativePower, 0, 1) |
||||
} |
||||
|
@ -1,15 +1,14 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
for i := 0; i < 50; i++ { |
||||
arg := z01.RandIntBetween(-2000000000, 2000000000) |
||||
z01.Challenge("Itoa", student.Itoa, correct.Itoa, arg) |
||||
arg := lib.RandIntBetween(-2000000000, 2000000000) |
||||
lib.Challenge("Itoa", student.Itoa, correct.Itoa, arg) |
||||
} |
||||
} |
||||
|
@ -1,21 +1,20 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
for i := 0; i < 30; i++ { |
||||
value := z01.RandIntBetween(-1000000, 1000000) |
||||
base := z01.RandIntBetween(2, 16) |
||||
z01.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, value, base) |
||||
value := lib.RandIntBetween(-1000000, 1000000) |
||||
base := lib.RandIntBetween(2, 16) |
||||
lib.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, value, base) |
||||
} |
||||
for i := 0; i < 5; i++ { |
||||
base := z01.RandIntBetween(2, 16) |
||||
z01.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, z01.MaxInt, base) |
||||
z01.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, z01.MinInt, base) |
||||
base := lib.RandIntBetween(2, 16) |
||||
lib.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, lib.MaxInt, base) |
||||
lib.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, lib.MinInt, base) |
||||
} |
||||
} |
||||
|
@ -1,21 +1,20 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := z01.MultRandASCII() |
||||
table := lib.MultRandASCII() |
||||
table = append(table, |
||||
"Hello!", |
||||
"Salut!", |
||||
"Ola!", |
||||
z01.RandStr(z01.RandIntBetween(1, 15), z01.RandAlnum()), |
||||
lib.RandStr(lib.RandIntBetween(1, 15), lib.RandAlnum()), |
||||
) |
||||
for _, arg := range table { |
||||
z01.Challenge("LastRune", student.LastRune, correct.LastRune, arg) |
||||
lib.Challenge("LastRune", student.LastRune, correct.LastRune, arg) |
||||
} |
||||
} |
||||
|
@ -1,18 +1,17 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
args := []int{z01.RandInt()} |
||||
limit := z01.RandIntBetween(20, 50) |
||||
args := []int{lib.RandInt()} |
||||
limit := lib.RandIntBetween(20, 50) |
||||
for i := 0; i < limit; i++ { |
||||
args = append(args, z01.RandInt()) |
||||
args = append(args, lib.RandInt()) |
||||
} |
||||
|
||||
z01.Challenge("Max", student.Max, correct.Max, args) |
||||
lib.Challenge("Max", student.Max, correct.Max, args) |
||||
} |
||||
|
@ -1,15 +1,14 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
student "./student" |
||||
"../lib" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
n := 0 |
||||
student.PointOne(&n) |
||||
if n != 1 { |
||||
z01.Fatalf("PointOne(&n), n == %d instead of 1\n", n) |
||||
lib.Fatalf("PointOne(&n), n == %d instead of 1\n", n) |
||||
} |
||||
} |
||||
|
@ -1,12 +1,11 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
z01.Challenge("PrintComb", student.PrintComb, correct.PrintComb) |
||||
lib.Challenge("PrintComb", student.PrintComb, correct.PrintComb) |
||||
} |
||||
|
@ -1,12 +1,11 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
z01.Challenge("PrintComb2", student.PrintComb2, correct.PrintComb2) |
||||
lib.Challenge("PrintComb2", student.PrintComb2, correct.PrintComb2) |
||||
} |
||||
|
@ -1,15 +1,14 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := []int{1, 2, 3, 4, 5, 6, 7, 8, 9} |
||||
for _, arg := range table { |
||||
z01.Challenge("PrintCombN", student.PrintCombN, correct.PrintCombN, arg) |
||||
lib.Challenge("PrintCombN", student.PrintCombN, correct.PrintCombN, arg) |
||||
} |
||||
} |
||||
|
@ -1,20 +1,19 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := append( |
||||
z01.MultRandInt(), |
||||
z01.MinInt, |
||||
z01.MaxInt, |
||||
lib.MultRandInt(), |
||||
lib.MinInt, |
||||
lib.MaxInt, |
||||
0, |
||||
) |
||||
for _, arg := range table { |
||||
z01.Challenge("PrintNbr", student.PrintNbr, correct.PrintNbr, arg) |
||||
lib.Challenge("PrintNbr", student.PrintNbr, correct.PrintNbr, arg) |
||||
} |
||||
} |
||||
|
@ -1,21 +1,20 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := append( |
||||
z01.MultRandIntBetween(0, z01.MaxInt), |
||||
z01.MaxInt, |
||||
lib.MultRandIntBetween(0, lib.MaxInt), |
||||
lib.MaxInt, |
||||
321, |
||||
321321, |
||||
0, |
||||
) |
||||
for _, arg := range table { |
||||
z01.Challenge("PrintNbrInOrder", student.PrintNbrInOrder, correct.PrintNbrInOrder, arg) |
||||
lib.Challenge("PrintNbrInOrder", student.PrintNbrInOrder, correct.PrintNbrInOrder, arg) |
||||
} |
||||
} |
||||
|
@ -1,16 +1,15 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"github.com/01-edu/z01" |
||||
|
||||
correct "./correct" |
||||
student "./student" |
||||
"../lib" |
||||
"./correct" |
||||
"./student" |
||||
) |
||||
|
||||
func main() { |
||||
table := z01.MultRandASCII() |
||||
table := lib.MultRandASCII() |
||||
table = append(table, "Hello World!") |
||||
for _, arg := range table { |
||||
z01.Challenge("PrintStr", student.PrintStr, correct.PrintStr, arg) |
||||
lib.Challenge("PrintStr", student.PrintStr, correct.PrintStr, arg) |
||||
} |
||||
} |
||||
|
Some files were not shown because too many files changed in this diff diff.show_more
Loading…
Reference in new issue