Browse Source

Convert last "prog" exercises as functions exercises (quand y'en a plus y'en a encor (sic))

content-update
Xavier Petit 4 years ago committed by xpetit
parent
commit
91e1d05433
  1. 3
      subjects/paramcount.en.md
  2. 39
      tests/go/solutions/addlinkednumbers/main.go
  3. 57
      tests/go/solutions/changeorder/main.go
  4. 12
      tests/go/solutions/chunk.go
  5. 23
      tests/go/solutions/chunk/main.go
  6. 19
      tests/go/solutions/fib/main.go
  7. 14
      tests/go/solutions/foldint/main.go
  8. 20
      tests/go/solutions/game23/main.go
  9. 22
      tests/go/solutions/interestingnumber/main.go
  10. 26
      tests/go/solutions/inverttree/main.go
  11. 23
      tests/go/solutions/merge/main.go
  12. 31
      tests/go/solutions/nauuo/main.go
  13. 35
      tests/go/solutions/paramcount/test_paramcount.go
  14. 87
      tests/go/solutions/printmemory/main.go
  15. 21
      tests/go/solutions/priorprime/main.go
  16. 8
      tests/go/solutions/reduceint.go
  17. 14
      tests/go/solutions/reduceint/main.go
  18. 14
      tests/go/solutions/reverse.go
  19. 29
      tests/go/solutions/reverse/main.go
  20. 44
      tests/go/solutions/revivethreenums/main.go
  21. 27
      tests/go/solutions/sametree/main.go
  22. 19
      tests/go/solutions/sortll.go
  23. 40
      tests/go/solutions/sortll/main.go
  24. 8
      tests/go/solutions/swapbits/main.go
  25. 35
      tests/go/solutions/swapbits/test_swapbits.go
  26. 60
      tests/go/solutions/sweetproblem/main.go
  27. 15
      tests/go/solutions/twosum/main.go
  28. 15
      tests/go/solutions/volumechanger/main.go
  29. 0
      tests/go/test_addlinkednumbers.go
  30. 0
      tests/go/test_addprimesum.go
  31. 0
      tests/go/test_alphamirror.go
  32. 0
      tests/go/test_balancedstring.go
  33. 0
      tests/go/test_brackets.go
  34. 0
      tests/go/test_brainfuck.go
  35. 0
      tests/go/test_changeorder.go
  36. 0
      tests/go/test_chunk.go
  37. 0
      tests/go/test_cleanstr.go
  38. 0
      tests/go/test_costumeprofit.go
  39. 0
      tests/go/test_countdown.go
  40. 0
      tests/go/test_displaya.go
  41. 0
      tests/go/test_displayalpham.go
  42. 0
      tests/go/test_displayalrevm.go
  43. 0
      tests/go/test_displayfirstparam.go
  44. 0
      tests/go/test_displaylastparam.go
  45. 0
      tests/go/test_displayz.go
  46. 0
      tests/go/test_expandstr.go
  47. 0
      tests/go/test_fib.go
  48. 0
      tests/go/test_firstword.go
  49. 0
      tests/go/test_foldint.go
  50. 0
      tests/go/test_fprime.go
  51. 0
      tests/go/test_game23.go
  52. 0
      tests/go/test_gcd.go
  53. 0
      tests/go/test_grouping.go
  54. 0
      tests/go/test_hello.go
  55. 0
      tests/go/test_hiddenp.go
  56. 0
      tests/go/test_inter.go
  57. 0
      tests/go/test_interestingnumber.go
  58. 0
      tests/go/test_inverttree.go
  59. 0
      tests/go/test_isanagram.go
  60. 0
      tests/go/test_ispowerof2.go
  61. 0
      tests/go/test_lastword.go
  62. 0
      tests/go/test_lcm.go
  63. 0
      tests/go/test_merge.go
  64. 0
      tests/go/test_nauuo.go
  65. 0
      tests/go/test_nenokku.go
  66. 0
      tests/go/test_onlya.go
  67. 0
      tests/go/test_onlyz.go
  68. 0
      tests/go/test_options.go
  69. 12
      tests/go/test_paramcount.go
  70. 0
      tests/go/test_piglatin.go
  71. 0
      tests/go/test_printbits.go
  72. 0
      tests/go/test_printchessboard.go
  73. 0
      tests/go/test_printhex.go
  74. 0
      tests/go/test_printmemory.go
  75. 0
      tests/go/test_priorprime.go
  76. 0
      tests/go/test_range.go
  77. 0
      tests/go/test_reduceint.go
  78. 0
      tests/go/test_repeatalpha.go
  79. 0
      tests/go/test_reverse.go
  80. 0
      tests/go/test_reversebits.go
  81. 0
      tests/go/test_reverserange.go
  82. 0
      tests/go/test_reversestrcap.go
  83. 0
      tests/go/test_revivethreenums.go
  84. 0
      tests/go/test_revwstr.go
  85. 0
      tests/go/test_robottoorigin.go
  86. 0
      tests/go/test_romannumbers.go
  87. 0
      tests/go/test_rostring.go
  88. 0
      tests/go/test_rot13.go
  89. 0
      tests/go/test_rpncalc.go
  90. 0
      tests/go/test_sametree.go
  91. 0
      tests/go/test_searchreplace.go
  92. 0
      tests/go/test_sortll.go
  93. 0
      tests/go/test_sweetproblem.go
  94. 0
      tests/go/test_switchcase.go
  95. 0
      tests/go/test_tabmult.go
  96. 0
      tests/go/test_twosum.go
  97. 0
      tests/go/test_union.go
  98. 0
      tests/go/test_uniqueoccurences.go
  99. 0
      tests/go/test_volumechanger.go
  100. 0
      tests/go/test_wdmatch.go

3
subjects/paramcount.en.md

@ -2,8 +2,7 @@
### Instructions
Write a program that displays the number of arguments passed to it. This number will be followed by
a newline (`'\n'`).
Write a program that displays the number of arguments passed to it. This number will be followed by a newline (`'\n'`).
If there is no argument, the program displays `0` followed by a newline.

39
tests/go/solutions/addlinkednumbers/main.go

@ -1,39 +0,0 @@
package main
type NodeAddL struct {
Next *NodeAddL
Num int
}
func pushFront(node *NodeAddL, num int) *NodeAddL {
tmp := &NodeAddL{Num: num}
if node == nil {
return tmp
}
tmp.Next = node
return tmp
}
func AddLinkedNumbers(num1, num2 *NodeAddL) *NodeAddL {
var n1, n2, r int
var result *NodeAddL
for tmp := num1; tmp != nil; tmp = tmp.Next {
n1 = n1*10 + tmp.Num
}
for tmp := num2; tmp != nil; tmp = tmp.Next {
n2 = n2*10 + tmp.Num
}
r = n1 + n2
for r > 0 {
mod := r % 10
r /= 10
result = pushFront(result, mod)
}
return result
}
func main() {
}

57
tests/go/solutions/changeorder/main.go

@ -1,57 +0,0 @@
package main
type NodeAddL struct {
Next *NodeAddL
Num int
}
func pushBack(node *NodeAddL, num int) *NodeAddL {
nw := &NodeAddL{Num: num}
if node == nil {
return nw
}
for tmp := node; tmp != nil; tmp = tmp.Next {
if tmp.Next == nil {
tmp.Next = nw
return node
}
}
return node
}
func Changeorder(node *NodeAddL) *NodeAddL {
if node == nil {
return node
}
ans := &NodeAddL{Num: node.Num}
for tmp := node; tmp != nil; {
tmp = tmp.Next
if tmp == nil {
break
}
tmp = tmp.Next
if tmp == nil {
break
}
ans = pushBack(ans, tmp.Num)
}
if node.Next == nil {
return ans
}
for tmp := node.Next; tmp != nil; {
ans = pushBack(ans, tmp.Num)
tmp = tmp.Next
if tmp == nil {
break
}
tmp = tmp.Next
if tmp == nil {
break
}
}
return ans
}
func main() {
}

12
tests/go/solutions/chunk.go

@ -2,19 +2,19 @@ package correct
import "fmt"
func Chunk(arr []int, ch int) {
func Chunk(a []int, ch int) {
slice := []int{}
if ch <= 0 {
fmt.Println()
return
}
result := make([][]int, 0, len(arr)/ch+1)
for len(arr) >= ch {
slice, arr = arr[:ch], arr[ch:]
result := make([][]int, 0, len(a)/ch+1)
for len(a) >= ch {
slice, a = a[:ch], a[ch:]
result = append(result, slice)
}
if len(arr) > 0 {
result = append(result, arr[:len(arr)])
if len(a) > 0 {
result = append(result, a[:len(a)])
}
fmt.Println(result)
}

23
tests/go/solutions/chunk/main.go

@ -1,23 +0,0 @@
package main
import "fmt"
func Chunk(slice []int, size int) {
newSlice := []int{}
if size <= 0 {
fmt.Println()
return
}
result := make([][]int, 0, len(slice)/size+1)
for len(slice) >= size {
newSlice, slice = slice[:size], slice[size:]
result = append(result, newSlice)
}
if len(slice) > 0 {
result = append(result, slice[:len(slice)])
}
fmt.Println(result)
}
func main() {
}

19
tests/go/solutions/fib/main.go

@ -1,19 +0,0 @@
package main
func Fib(n int) int {
if n <= 0 {
return 0
}
t1 := 0
t2 := 1
for i := 2; i <= n; i++ {
t1 += t2
tmp := t1
t1 = t2
t2 = tmp
}
return t2
}
func main() {
}

14
tests/go/solutions/foldint/main.go

@ -1,14 +0,0 @@
package main
import "fmt"
func FoldInt(f func(int, int) int, a []int, n int) {
result := n
for _, v := range a {
result = f(result, v)
}
fmt.Println(result)
}
func main() {
}

20
tests/go/solutions/game23/main.go

@ -1,20 +0,0 @@
package main
func Game23(a, b int) int {
if a > b {
return -1
}
if a == b {
return 0
}
if Game23(a*2, b) != -1 {
return 1 + Game23(a*2, b)
}
if Game23(a*3, b) != -1 {
return 1 + Game23(a*3, b)
}
return -1
}
func main() {
}

22
tests/go/solutions/interestingnumber/main.go

@ -1,22 +0,0 @@
package main
func isInteresting(n int) bool {
s := 0
for n > 0 {
s += n % 10
n /= 10
}
return s%7 == 0
}
func InterestingNumber(n int) int {
for {
if isInteresting(n) {
return n
}
n++
}
}
func main() {
}

26
tests/go/solutions/inverttree/main.go

@ -1,26 +0,0 @@
package main
type TNode struct {
Val int
Left *TNode
Right *TNode
}
func Invert(root *TNode) {
if root != nil {
temp := root.Left
root.Left = root.Right
root.Right = temp
Invert(root.Left)
Invert(root.Right)
}
}
func InvertTree(root *TNode) *TNode {
Invert(root)
return root
}
func main() {
}

23
tests/go/solutions/merge/main.go

@ -1,23 +0,0 @@
package main
type TreeNodeM struct {
Left *TreeNodeM
Val int
Right *TreeNodeM
}
func MergeTrees(t1 *TreeNodeM, t2 *TreeNodeM) *TreeNodeM {
if t1 == nil {
return t2
}
if t2 == nil {
return t1
}
t1.Val += t2.Val
t1.Left = MergeTrees(t1.Left, t2.Left)
t1.Right = MergeTrees(t1.Right, t2.Right)
return t1
}
func main() {
}

31
tests/go/solutions/nauuo/main.go

@ -1,31 +0,0 @@
package main
func Nauuo(plus, minus, rand int) string {
if rand == 0 {
if plus > minus {
return "+"
}
if plus < minus {
return "-"
}
if plus == minus {
return "0"
}
}
if plus > minus+rand {
return "+"
}
if plus+rand < minus {
return "-"
}
if (plus+rand >= minus) && (plus-rand <= minus) {
return "?"
}
if (minus+rand >= plus) && (minus-rand <= plus) {
return "?"
}
return "?"
}
func main() {
}

35
tests/go/solutions/paramcount/test_paramcount.go

@ -1,35 +0,0 @@
package main
import (
"strconv"
"github.com/01-edu/z01"
)
func main() {
arg1 := []string{"2", "5", "u", "19"}
arg2 := []string{"2"}
arg3 := []string{"1", "2", "3", "5", "7", "24"}
arg4 := []string{"6", "12", "24"}
args := [][]string{arg1, arg2, arg3, arg4}
for i := 0; i < 10; i++ {
var arg []string
init := z01.RandIntBetween(0, 10)
for i := init; i < init+z01.RandIntBetween(5, 10); i++ {
arg = append(arg, strconv.Itoa(i))
}
args = append(args, arg)
}
for i := 0; i < 1; i++ {
args = append(args, z01.MultRandWords())
}
for _, v := range args {
z01.ChallengeMain("paramcount", v...)
}
z01.ChallengeMain("paramcount")
}

87
tests/go/solutions/printmemory/main.go

@ -1,87 +0,0 @@
package main
import "github.com/01-edu/z01"
func printBase(nbr int) int {
var result []rune
base := "0123456789abcdef"
typeBase := []rune(base)
a := 0
pos := 0
i := 0
if nbr == 0 {
result = append(result, '0', '0')
i = 2
}
for nbr > 0 {
pos = nbr % 16
nbr = nbr / 16
result = append(result, typeBase[pos])
i++
}
if i == 1 {
result = append(result, '0')
i = 2
}
for j := i - 1; j >= 0; j-- {
z01.PrintRune(result[j])
a++
}
return a
}
func printascii(a int) {
if a > 31 && a < 127 {
z01.PrintRune(rune(a))
} else {
z01.PrintRune('.')
}
}
func printLine(arr [10]int, start int, max int) {
a := 0
a = start
aux := 0
var b int
for a < start+16 && a < max {
if a%4 == 0 && a != 0 {
z01.PrintRune('\n')
}
b = 8 - printBase(arr[a])
for aux != b {
if b == 6 {
z01.PrintRune('0')
}
if aux == 1 {
z01.PrintRune(' ')
}
if b < 6 {
z01.PrintRune('0')
}
aux++
}
z01.PrintRune(' ')
aux = 0
a++
}
z01.PrintRune('\n')
c := start
for c < start+16 && c < max {
printascii(arr[c])
c++
}
z01.PrintRune('\n')
}
func PrintMemory(arr [10]int) {
i := 0
size := len(arr)
for i < size {
printLine(arr, i, size)
i += 16
}
}
func main() {
}

21
tests/go/solutions/priorprime/main.go

@ -1,21 +0,0 @@
package main
func PriorPrime(x int) int {
ans := 0
ok := 0
for i := 2; i < x; i++ {
ok = 1
for j := 2; j*j <= i; j++ {
if i%j == 0 {
ok = 0
}
}
if ok == 1 {
ans += i
}
}
return ans
}
func main() {
}

8
tests/go/solutions/reduceint.go

@ -2,10 +2,10 @@ package correct
import "fmt"
func ReduceInt(f func(int, int) int, arr []int) {
acc := arr[0]
for i := 1; i < len(arr); i++ {
acc = f(acc, arr[i])
func ReduceInt(f func(int, int) int, a []int) {
acc := a[0]
for i := 1; i < len(a); i++ {
acc = f(acc, a[i])
}
fmt.Println(acc)
}

14
tests/go/solutions/reduceint/main.go

@ -1,14 +0,0 @@
package main
import "fmt"
func ReduceInt(f func(int, int) int, arr []int) {
acc := arr[0]
for i := 1; i < len(arr); i++ {
acc = f(acc, arr[i])
}
fmt.Println(acc)
}
func main() {
}

14
tests/go/solutions/reverse.go

@ -1,5 +1,19 @@
package correct
type NodeAddL struct {
Next *NodeAddL
Num int
}
func pushFront(node *NodeAddL, num int) *NodeAddL {
tmp := &NodeAddL{Num: num}
if node == nil {
return tmp
}
tmp.Next = node
return tmp
}
func Reverse(node *NodeAddL) *NodeAddL {
if node == nil {
return node

29
tests/go/solutions/reverse/main.go

@ -1,29 +0,0 @@
package main
type NodeAddL struct {
Next *NodeAddL
Num int
}
func pushFront(node *NodeAddL, num int) *NodeAddL {
tmp := &NodeAddL{Num: num}
if node == nil {
return tmp
}
tmp.Next = node
return tmp
}
func Reverse(node *NodeAddL) *NodeAddL {
if node == nil {
return node
}
ans := &NodeAddL{Num: node.Num}
for tmp := node.Next; tmp != nil; tmp = tmp.Next {
ans = pushFront(ans, tmp.Num)
}
return ans
}
func main() {
}

44
tests/go/solutions/revivethreenums/main.go

@ -1,44 +0,0 @@
package main
func more(a, b int) int {
if a < b {
return b
}
return a
}
func max(a, b, c, d int) int {
if a >= b && a >= c && a >= d {
return a
}
if b >= a && b >= c && b >= d {
return b
}
if c >= a && c >= b && c >= d {
return c
}
if d >= a && d >= b && d >= c {
return d
}
return -1
}
func ReviveThreeNums(a, b, c, d int) int {
maxi := -111
if a != max(a, b, c, d) {
maxi = more(maxi, max(a, b, c, d)-a)
}
if b != max(a, b, c, d) {
maxi = more(maxi, max(a, b, c, d)-b)
}
if c != max(a, b, c, d) {
maxi = more(maxi, max(a, b, c, d)-c)
}
if d != max(a, b, c, d) {
maxi = more(maxi, max(a, b, c, d)-d)
}
return maxi
}
func main() {
}

27
tests/go/solutions/sametree/main.go

@ -1,27 +0,0 @@
package main
type TreeNodeL struct {
Left *TreeNodeL
Val int
Right *TreeNodeL
}
func IsSameTree(p *TreeNodeL, q *TreeNodeL) bool {
if p == nil && q == nil {
return true
}
return checkIfEq(p, q)
}
func checkIfEq(t1 *TreeNodeL, t2 *TreeNodeL) bool {
if t1 == nil && t2 == nil {
return true
}
if t1 == nil || t2 == nil {
return false
}
return t1.Val == t2.Val && checkIfEq(t1.Right, t2.Right) && checkIfEq(t1.Left, t2.Left)
}
func main() {
}

19
tests/go/solutions/sortll.go

@ -1,5 +1,24 @@
package correct
type NodeAddL struct {
Next *NodeAddL
Num int
}
func pushBack(node *NodeAddL, num int) *NodeAddL {
nw := &NodeAddL{Num: num}
if node == nil {
return nw
}
for tmp := node; tmp != nil; tmp = tmp.Next {
if tmp.Next == nil {
tmp.Next = nw
return node
}
}
return node
}
func Sortll(node *NodeAddL) *NodeAddL {
if node == nil {
return node

40
tests/go/solutions/sortll/main.go

@ -1,40 +0,0 @@
package main
type NodeAddL struct {
Next *NodeAddL
Num int
}
func pushBack(node *NodeAddL, num int) *NodeAddL {
nw := &NodeAddL{Num: num}
if node == nil {
return nw
}
for tmp := node; tmp != nil; tmp = tmp.Next {
if tmp.Next == nil {
tmp.Next = nw
return node
}
}
return node
}
func Sortll(node *NodeAddL) *NodeAddL {
if node == nil {
return node
}
for first := node; first != nil; first = first.Next {
for second := first.Next; second != nil; second = second.Next {
if first.Num < second.Num {
tmp := first.Num
first.Num = second.Num
second.Num = tmp
}
}
}
return node
}
func main() {
}

8
tests/go/solutions/swapbits/main.go

@ -1,8 +0,0 @@
package main
func SwapBits(n byte) byte {
return ((n >> 4) | (n << 4))
}
func main() {
}

35
tests/go/solutions/swapbits/test_swapbits.go

@ -1,35 +0,0 @@
package main
import (
"reflect"
"github.com/01-edu/z01"
correct "./correct"
)
func challengeBytes(fn1, fn2 interface{}, args ...interface{}) {
st1 := z01.Monitor(fn1, args)
st2 := z01.Monitor(fn2, args)
if !reflect.DeepEqual(st1.Results, st2.Results) {
z01.Fatalf("%s(%08b) == %08b instead of %08b\n",
"SwapBits",
args[0].(byte),
st1.Results[0].(byte),
st2.Results[0].(byte),
)
}
}
func main() {
args := []byte{0x24, 0x14, 0x11, 0x22, 0xd2, 0x15, 0xff, 0x0, 0x35, 0x58, 0x43}
for i := 0; i < 10; i++ {
n := z01.RandIntBetween(0, 255)
args = append(args, byte(n))
}
for _, v := range args {
challengeBytes(SwapBits, correct.SwapBits, v)
}
}

60
tests/go/solutions/sweetproblem/main.go

@ -1,60 +0,0 @@
package main
func min3(a, b, c int) int {
if a <= b && a <= c {
return a
}
if b <= a && b <= c {
return b
}
return c
}
func max3(a, b, c int) int {
if a >= b && a >= c {
return a
}
if b >= a && b >= c {
return b
}
return c
}
func min2(a, b int) int {
if a <= b {
return a
}
return b
}
func Sweetproblem(a, b, c int) int {
if a > b {
f := a
a = b
b = f
}
if a > c {
f := a
a = c
c = f
}
if b > c {
f := b
b = c
c = f
}
ans := a
if c-b >= a {
c -= a
} else {
a -= c - b
half := a / 2
c -= half
b -= a - half
}
ans += min2(b, c)
return ans
}
func main() {
}

15
tests/go/solutions/twosum/main.go

@ -1,15 +0,0 @@
package main
func TwoSum(nums []int, target int) []int {
for i := 0; i < len(nums); i++ {
for j := i + 1; j < len(nums); j++ {
if nums[i]+nums[j] == target {
return []int{i, j}
}
}
}
return nil
}
func main() {
}

15
tests/go/solutions/volumechanger/main.go

@ -1,15 +0,0 @@
package main
func abs(a int) int {
if a < 0 {
return -a
}
return a
}
func Volumechanger(a, b int) int {
return abs(a-b)/5 + abs(a-b)%5/2 + abs(a-b)%5%2
}
func main() {
}

0
tests/go/solutions/addlinkednumbers/test_addlinkednumbers.go → tests/go/test_addlinkednumbers.go

0
tests/go/solutions/addprimesum/test_addprimesum.go → tests/go/test_addprimesum.go

0
tests/go/solutions/alphamirror/test_alphamirror.go → tests/go/test_alphamirror.go

0
tests/go/solutions/balancedstring/test_balancedstring.go → tests/go/test_balancedstring.go

0
tests/go/solutions/brackets/test_brackets.go → tests/go/test_brackets.go

0
tests/go/solutions/brainfuck/test_brainfuck.go → tests/go/test_brainfuck.go

0
tests/go/solutions/changeorder/test_changeorder.go → tests/go/test_changeorder.go

0
tests/go/solutions/chunk/test_chunk.go → tests/go/test_chunk.go

0
tests/go/solutions/cleanstr/test_cleanstr.go → tests/go/test_cleanstr.go

0
tests/go/solutions/costumeprofit/test_costumeprofit.go → tests/go/test_costumeprofit.go

0
tests/go/solutions/countdown/test_countdown.go → tests/go/test_countdown.go

0
tests/go/solutions/displaya/test_displaya.go → tests/go/test_displaya.go

0
tests/go/solutions/displayalpham/test_displayalpham.go → tests/go/test_displayalpham.go

0
tests/go/solutions/displayalrevm/test_displayalrevm.go → tests/go/test_displayalrevm.go

0
tests/go/solutions/displayfirstparam/test_displayfirstparam.go → tests/go/test_displayfirstparam.go

0
tests/go/solutions/displaylastparam/test_displaylastparam.go → tests/go/test_displaylastparam.go

0
tests/go/solutions/displayz/test_displayz.go → tests/go/test_displayz.go

0
tests/go/solutions/expandstr/test_expandstr.go → tests/go/test_expandstr.go

0
tests/go/solutions/fib/test_fib.go → tests/go/test_fib.go

0
tests/go/solutions/firstword/test_firstword.go → tests/go/test_firstword.go

0
tests/go/solutions/foldint/test_foldint.go → tests/go/test_foldint.go

0
tests/go/solutions/fprime/test_fprime.go → tests/go/test_fprime.go

0
tests/go/solutions/game23/test_game23.go → tests/go/test_game23.go

0
tests/go/solutions/gcd/test_gcd.go → tests/go/test_gcd.go

0
tests/go/solutions/grouping/test_grouping.go → tests/go/test_grouping.go

0
tests/go/solutions/hello/test_hello.go → tests/go/test_hello.go

0
tests/go/solutions/hiddenp/test_hiddenp.go → tests/go/test_hiddenp.go

0
tests/go/solutions/inter/test_inter.go → tests/go/test_inter.go

0
tests/go/solutions/interestingnumber/test_interestingnumber.go → tests/go/test_interestingnumber.go

0
tests/go/solutions/inverttree/test_inverttree.go → tests/go/test_inverttree.go

0
tests/go/solutions/isanagram/test_isanagram.go → tests/go/test_isanagram.go

0
tests/go/solutions/ispowerof2/test_ispowerof2.go → tests/go/test_ispowerof2.go

0
tests/go/solutions/lastword/test_lastword.go → tests/go/test_lastword.go

0
tests/go/solutions/lcm/test_lcm.go → tests/go/test_lcm.go

0
tests/go/solutions/merge/test_merge.go → tests/go/test_merge.go

0
tests/go/solutions/nauuo/test_nauuo.go → tests/go/test_nauuo.go

0
tests/go/solutions/nenokku/test_nenokku.go → tests/go/test_nenokku.go

0
tests/go/solutions/onlya/test_onlya.go → tests/go/test_onlya.go

0
tests/go/solutions/onlyz/test_onlyz.go → tests/go/test_onlyz.go

0
tests/go/solutions/options/test_options.go → tests/go/test_options.go

12
tests/go/test_paramcount.go

@ -7,12 +7,12 @@ import (
)
func main() {
arg1 := []string{"2", "5", "u", "19"}
arg2 := []string{"2"}
arg3 := []string{"1", "2", "3", "5", "7", "24"}
arg4 := []string{"6", "12", "24"}
args := [][]string{arg1, arg2, arg3, arg4}
args := [][]string{
{"2", "5", "u", "19"},
{"2"},
{"1", "2", "3", "5", "7", "24"},
{"6", "12", "24"},
}
for i := 0; i < 10; i++ {
var arg []string

0
tests/go/solutions/piglatin/test_piglatin.go → tests/go/test_piglatin.go

0
tests/go/solutions/printbits/test_printbits.go → tests/go/test_printbits.go

0
tests/go/solutions/printchessboard/test_printchessboard.go → tests/go/test_printchessboard.go

0
tests/go/solutions/printhex/test_printhex.go → tests/go/test_printhex.go

0
tests/go/solutions/printmemory/test_printmemory.go → tests/go/test_printmemory.go

0
tests/go/solutions/priorprime/test_priorprime.go → tests/go/test_priorprime.go

0
tests/go/solutions/range/test_range.go → tests/go/test_range.go

0
tests/go/solutions/reduceint/test_reduceint.go → tests/go/test_reduceint.go

0
tests/go/solutions/repeatalpha/test_repeatalpha.go → tests/go/test_repeatalpha.go

0
tests/go/solutions/reverse/test_reverse.go → tests/go/test_reverse.go

0
tests/go/solutions/reversebits/test_reversebits.go → tests/go/test_reversebits.go

0
tests/go/solutions/reverserange/test_reverserange.go → tests/go/test_reverserange.go

0
tests/go/solutions/reversestrcap/test_reversestrcap.go → tests/go/test_reversestrcap.go

0
tests/go/solutions/revivethreenums/test_revivethreenums.go → tests/go/test_revivethreenums.go

0
tests/go/solutions/revwstr/test_revwstr.go → tests/go/test_revwstr.go

0
tests/go/solutions/robottoorigin/test_robottoorigin.go → tests/go/test_robottoorigin.go

0
tests/go/solutions/romannumbers/test_romannumbers.go → tests/go/test_romannumbers.go

0
tests/go/solutions/rostring/test_rostring.go → tests/go/test_rostring.go

0
tests/go/solutions/rot13/test_rot13.go → tests/go/test_rot13.go

0
tests/go/solutions/rpncalc/test_rpncalc.go → tests/go/test_rpncalc.go

0
tests/go/solutions/sametree/test_sametree.go → tests/go/test_sametree.go

0
tests/go/solutions/searchreplace/test_searchreplace.go → tests/go/test_searchreplace.go

0
tests/go/solutions/sortll/test_sortll.go → tests/go/test_sortll.go

0
tests/go/solutions/sweetproblem/test_sweetproblem.go → tests/go/test_sweetproblem.go

0
tests/go/solutions/switchcase/test_switchcase.go → tests/go/test_switchcase.go

0
tests/go/solutions/tabmult/test_tabmult.go → tests/go/test_tabmult.go

0
tests/go/solutions/twosum/test_twosum.go → tests/go/test_twosum.go

0
tests/go/solutions/union/test_union.go → tests/go/test_union.go

0
tests/go/solutions/uniqueoccurences/test_uniqueoccurences.go → tests/go/test_uniqueoccurences.go

0
tests/go/solutions/volumechanger/test_volumechanger.go → tests/go/test_volumechanger.go

0
tests/go/solutions/wdmatch/test_wdmatch.go → tests/go/test_wdmatch.go

Loading…
Cancel
Save