mirror of https://github.com/01-edu/public.git
Xavier Petit
5 years ago
committed by
xpetit
207 changed files with 1154 additions and 1287 deletions
@ -1,18 +1,17 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
arg := z01.MultRandInt() |
arg := lib.MultRandInt() |
||||||
arg = append(arg, z01.RandInt()) |
arg = append(arg, lib.RandInt()) |
||||||
for i := 0; i < 15; i++ { |
for i := 0; i < 15; i++ { |
||||||
z01.Challenge("Abort", student.Abort, correct.Abort, arg[0], arg[1], arg[2], arg[3], arg[4]) |
lib.Challenge("Abort", student.Abort, correct.Abort, arg[0], arg[1], arg[2], arg[3], arg[4]) |
||||||
arg = z01.MultRandInt() |
arg = lib.MultRandInt() |
||||||
arg = append(arg, z01.RandInt()) |
arg = append(arg, lib.RandInt()) |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,18 +1,17 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
args := []int{z01.RandIntBetween(2, 20)} |
args := []int{lib.RandIntBetween(2, 20)} |
||||||
args = append(args, z01.MultRandIntBetween(2, 20)...) |
args = append(args, lib.MultRandIntBetween(2, 20)...) |
||||||
args = append(args, z01.MultRandIntBetween(2, 20)...) |
args = append(args, lib.MultRandIntBetween(2, 20)...) |
||||||
|
|
||||||
for _, v := range args { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
args := []int{z01.RandIntBetween(-6, 20)} |
args := []int{lib.RandIntBetween(-6, 20)} |
||||||
args = append(args, -5, 0) |
args = append(args, -5, 0) |
||||||
for i := 0; i < 20; i++ { |
for i := 0; i < 20; i++ { |
||||||
args = append(args, z01.RandIntBetween(2, 20)) |
args = append(args, lib.RandIntBetween(2, 20)) |
||||||
} |
} |
||||||
|
|
||||||
for _, v := range args { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
z01.Challenge("EightQueens", student.EightQueens, correct.EightQueens) |
lib.Challenge("EightQueens", student.EightQueens, correct.EightQueens) |
||||||
} |
} |
||||||
|
@ -1,20 +1,19 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := append( |
table := append( |
||||||
z01.MultRandIntBetween(0, 25), |
lib.MultRandIntBetween(0, 25), |
||||||
4, |
4, |
||||||
5, |
5, |
||||||
-5, |
-5, |
||||||
) |
) |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
a := append(z01.MultRandIntBetween(0, 99999), 5, 4, 1) |
a := append(lib.MultRandIntBetween(0, 99999), 5, 4, 1) |
||||||
for _, elem := range a { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := append( |
table := append( |
||||||
z01.MultRandASCII(), |
lib.MultRandASCII(), |
||||||
"Hello!", |
"Hello!", |
||||||
"Salut!", |
"Salut!", |
||||||
"Ola!", |
"Ola!", |
||||||
"♥01", |
"♥01", |
||||||
) |
) |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := append( |
table := append( |
||||||
z01.MultRandInt(), |
lib.MultRandInt(), |
||||||
z01.MinInt, |
lib.MinInt, |
||||||
z01.MaxInt, |
lib.MaxInt, |
||||||
0, |
0, |
||||||
) |
) |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
i := 0 |
i := 0 |
||||||
for i < 30 { |
for i < 30 { |
||||||
nb := z01.RandIntBetween(-8, 8) |
nb := lib.RandIntBetween(-8, 8) |
||||||
power := z01.RandIntBetween(-10, 10) |
power := lib.RandIntBetween(-10, 10) |
||||||
z01.Challenge("IterativePower", student.IterativePower, correct.IterativePower, nb, power) |
lib.Challenge("IterativePower", student.IterativePower, correct.IterativePower, nb, power) |
||||||
i++ |
i++ |
||||||
} |
} |
||||||
z01.Challenge("IterativePower", student.IterativePower, correct.IterativePower, 0, 0) |
lib.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, 1) |
||||||
} |
} |
||||||
|
@ -1,15 +1,14 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
for i := 0; i < 50; i++ { |
for i := 0; i < 50; i++ { |
||||||
arg := z01.RandIntBetween(-2000000000, 2000000000) |
arg := lib.RandIntBetween(-2000000000, 2000000000) |
||||||
z01.Challenge("Itoa", student.Itoa, correct.Itoa, arg) |
lib.Challenge("Itoa", student.Itoa, correct.Itoa, arg) |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,21 +1,20 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
for i := 0; i < 30; i++ { |
for i := 0; i < 30; i++ { |
||||||
value := z01.RandIntBetween(-1000000, 1000000) |
value := lib.RandIntBetween(-1000000, 1000000) |
||||||
base := z01.RandIntBetween(2, 16) |
base := lib.RandIntBetween(2, 16) |
||||||
z01.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, value, base) |
lib.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, value, base) |
||||||
} |
} |
||||||
for i := 0; i < 5; i++ { |
for i := 0; i < 5; i++ { |
||||||
base := z01.RandIntBetween(2, 16) |
base := lib.RandIntBetween(2, 16) |
||||||
z01.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, z01.MaxInt, base) |
lib.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, lib.MaxInt, base) |
||||||
z01.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, z01.MinInt, base) |
lib.Challenge("ItoaBase", student.ItoaBase, correct.ItoaBase, lib.MinInt, base) |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,21 +1,20 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := z01.MultRandASCII() |
table := lib.MultRandASCII() |
||||||
table = append(table, |
table = append(table, |
||||||
"Hello!", |
"Hello!", |
||||||
"Salut!", |
"Salut!", |
||||||
"Ola!", |
"Ola!", |
||||||
z01.RandStr(z01.RandIntBetween(1, 15), z01.RandAlnum()), |
lib.RandStr(lib.RandIntBetween(1, 15), lib.RandAlnum()), |
||||||
) |
) |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
args := []int{z01.RandInt()} |
args := []int{lib.RandInt()} |
||||||
limit := z01.RandIntBetween(20, 50) |
limit := lib.RandIntBetween(20, 50) |
||||||
for i := 0; i < limit; i++ { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
n := 0 |
n := 0 |
||||||
student.PointOne(&n) |
student.PointOne(&n) |
||||||
if n != 1 { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
z01.Challenge("PrintComb", student.PrintComb, correct.PrintComb) |
lib.Challenge("PrintComb", student.PrintComb, correct.PrintComb) |
||||||
} |
} |
||||||
|
@ -1,12 +1,11 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
z01.Challenge("PrintComb2", student.PrintComb2, correct.PrintComb2) |
lib.Challenge("PrintComb2", student.PrintComb2, correct.PrintComb2) |
||||||
} |
} |
||||||
|
@ -1,15 +1,14 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := []int{1, 2, 3, 4, 5, 6, 7, 8, 9} |
table := []int{1, 2, 3, 4, 5, 6, 7, 8, 9} |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := append( |
table := append( |
||||||
z01.MultRandInt(), |
lib.MultRandInt(), |
||||||
z01.MinInt, |
lib.MinInt, |
||||||
z01.MaxInt, |
lib.MaxInt, |
||||||
0, |
0, |
||||||
) |
) |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := append( |
table := append( |
||||||
z01.MultRandIntBetween(0, z01.MaxInt), |
lib.MultRandIntBetween(0, lib.MaxInt), |
||||||
z01.MaxInt, |
lib.MaxInt, |
||||||
321, |
321, |
||||||
321321, |
321321, |
||||||
0, |
0, |
||||||
) |
) |
||||||
for _, arg := range table { |
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 |
package main |
||||||
|
|
||||||
import ( |
import ( |
||||||
"github.com/01-edu/z01" |
"../lib" |
||||||
|
"./correct" |
||||||
correct "./correct" |
"./student" |
||||||
student "./student" |
|
||||||
) |
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := z01.MultRandASCII() |
table := lib.MultRandASCII() |
||||||
table = append(table, "Hello World!") |
table = append(table, "Hello World!") |
||||||
for _, arg := range table { |
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