Browse Source

Formatting

content-update
xpetit 3 years ago
parent
commit
c1a6a60cef
No known key found for this signature in database
GPG Key ID: 97C60669182C17A5
  1. 3
      go/tests/prog/brainfuck_test/main.go
  2. 2
      go/tests/prog/chunk_test/main.go
  3. 1
      go/tests/prog/doop_test/main.go
  4. 3
      go/tests/prog/foreach_test/main.go
  5. 1
      go/tests/prog/grouping_prog/main.go
  6. 6
      go/tests/prog/listat_test/main.go
  7. 10
      go/tests/prog/listclear_test/main.go
  8. 10
      go/tests/prog/listfind_test/main.go
  9. 10
      go/tests/prog/listforeach_test/main.go
  10. 10
      go/tests/prog/listforeachif_test/main.go
  11. 10
      go/tests/prog/listlast_test/main.go
  12. 10
      go/tests/prog/listmerge_test/main.go
  13. 6
      go/tests/prog/listpushback_test/main.go
  14. 6
      go/tests/prog/listpushfront_test/main.go
  15. 10
      go/tests/prog/listremoveif_test/main.go
  16. 10
      go/tests/prog/listreverse_test/main.go
  17. 10
      go/tests/prog/listsize_test/main.go
  18. 6
      go/tests/prog/listsort_test/main.go
  19. 6
      go/tests/prog/sortedlistmerge_test/main.go
  20. 6
      go/tests/prog/sortlistinsert_test/main.go
  21. 6
      go/tests/prog/split_test/main.go
  22. 10
      go/tests/prog/tetrisoptimizer_prog/validation.go
  23. 1
      go/tests/prog/ztail_prog/main.go

3
go/tests/prog/brainfuck_test/main.go

@ -9,7 +9,8 @@ import (
func main() {
// individual tests 1)Hello World! 2)Hi 3)abc 4)ABC
args := []string{"++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.",
args := []string{
"++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.",
"+++++[>++++[>++++H>+++++i<<-]>>>++\n<<<<-]>>--------.>+++++.>.",
"++++++++++[>++++++++++>++++++++++>++++++++++<<<-]>---.>--.>-.>++++++++++.",
"ld++++++++++++++++++++++++++++++++++++++++++++this+is++a++++comment++++++++++++++[>d+<-]>.+.+.>++++++++++.",

2
go/tests/prog/chunk_test/main.go

@ -20,7 +20,7 @@ func chunk(a []int, ch int) {
result = append(result, slice)
}
if len(a) > 0 {
result = append(result, a[:len(a)])
result = append(result, a[:])
}
fmt.Println(result)
}

1
go/tests/prog/doop_test/main.go

@ -18,7 +18,6 @@ func main() {
for _, operator := range operatorsTable {
table = append(table, firstArg+" "+operator+" "+secondArg)
}
}

3
go/tests/prog/foreach_test/main.go

@ -17,12 +17,15 @@ func forEach(f func(int), a []int) {
func add0(i int) {
fmt.Println(i)
}
func add1(i int) {
fmt.Println(i + 1)
}
func add2(i int) {
fmt.Println(i + 2)
}
func add3(i int) {
fmt.Println(i + 3)
}

1
go/tests/prog/grouping_prog/main.go

@ -52,6 +52,7 @@ func brackets(regexp, text string) {
}
}
}
func main() {
if len(os.Args) == 3 {
brackets(os.Args[1], os.Args[2])

6
go/tests/prog/listat_test/main.go

@ -8,8 +8,10 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node5 = student.NodeL
type NodeS5 = correct.NodeL
type (
Node5 = student.NodeL
NodeS5 = correct.NodeL
)
func nodePushBackList5(l1 *Node5, l2 *NodeS5, data interface{}) (*Node5, *NodeS5) {
n1 := &Node5{Data: data}

10
go/tests/prog/listclear_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node4 = student.NodeL
type List4 = correct.List
type NodeS4 = correct.NodeL
type ListS4 = student.List
type (
Node4 = student.NodeL
List4 = correct.List
NodeS4 = correct.NodeL
ListS4 = student.List
)
func listToStringStu5(l *ListS4) string {
var res string

10
go/tests/prog/listfind_test/main.go

@ -8,10 +8,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node9 = student.NodeL
type List9 = correct.List
type NodeS9 = correct.NodeL
type ListS9 = student.List
type (
Node9 = student.NodeL
List9 = correct.List
NodeS9 = correct.NodeL
ListS9 = student.List
)
func listPushBackTest9(l1 *ListS9, l2 *List9, data interface{}) {
n := &Node9{Data: data}

10
go/tests/prog/listforeach_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node7 = student.NodeL
type List7 = correct.List
type NodeS7 = correct.NodeL
type ListS7 = student.List
type (
Node7 = student.NodeL
List7 = correct.List
NodeS7 = correct.NodeL
ListS7 = student.List
)
func listToStringStu8(l *ListS7) string {
var res string

10
go/tests/prog/listforeachif_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node8 = student.NodeL
type List8 = correct.List
type NodeS8 = correct.NodeL
type ListS8 = student.List
type (
Node8 = student.NodeL
List8 = correct.List
NodeS8 = correct.NodeL
ListS8 = student.List
)
// function to apply, in listforeachif
func addOneS(node *NodeS8) {

10
go/tests/prog/listlast_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node3 = student.NodeL
type List3 = correct.List
type NodeS3 = correct.NodeL
type ListS3 = student.List
type (
Node3 = student.NodeL
List3 = correct.List
NodeS3 = correct.NodeL
ListS3 = student.List
)
func listToStringStu9(l *ListS3) string {
var res string

10
go/tests/prog/listmerge_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node11 = student.NodeL
type List11 = correct.List
type NodeS11 = correct.NodeL
type ListS11 = student.List
type (
Node11 = student.NodeL
List11 = correct.List
NodeS11 = correct.NodeL
ListS11 = student.List
)
func listToStringStu(l *ListS11) string {
var res string

6
go/tests/prog/listpushback_test/main.go

@ -10,8 +10,10 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type ListS = correct.List
type List = student.List
type (
ListS = correct.List
List = student.List
)
func listToStringStu10(l *List) string {
var res string

6
go/tests/prog/listpushfront_test/main.go

@ -10,8 +10,10 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type ListSa = correct.List
type Lista = student.List
type (
ListSa = correct.List
Lista = student.List
)
func listToStringStu11(l *Lista) string {
var res string

10
go/tests/prog/listremoveif_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node10 = student.NodeL
type List10 = correct.List
type NodeS10 = correct.NodeL
type ListS10 = student.List
type (
Node10 = student.NodeL
List10 = correct.List
NodeS10 = correct.NodeL
ListS10 = student.List
)
func listToStringStu12(l *ListS10) string {
var res string

10
go/tests/prog/listreverse_test/main.go

@ -10,10 +10,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node6 = student.NodeL
type List6 = correct.List
type NodeS6 = correct.NodeL
type ListS6 = student.List
type (
Node6 = student.NodeL
List6 = correct.List
NodeS6 = correct.NodeL
ListS6 = student.List
)
func listToStringStu13(l *ListS6) string {
var res string

10
go/tests/prog/listsize_test/main.go

@ -8,10 +8,12 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type Node2 = student.NodeL
type List2 = correct.List
type NodeS2 = correct.NodeL
type ListS2 = student.List
type (
Node2 = student.NodeL
List2 = correct.List
NodeS2 = correct.NodeL
ListS2 = student.List
)
func listPushBackTest2(l *ListS2, l1 *List2, data interface{}) {
n := &Node2{Data: data}

6
go/tests/prog/listsort_test/main.go

@ -10,8 +10,10 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type NodeI12 = student.NodeI
type NodeIS12 = correct.NodeI
type (
NodeI12 = student.NodeI
NodeIS12 = correct.NodeI
)
func printListStudent(n *NodeI12) string {
var res string

6
go/tests/prog/sortedlistmerge_test/main.go

@ -10,8 +10,10 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type NodeI13 = student.NodeI
type NodeIS13 = correct.NodeI
type (
NodeI13 = student.NodeI
NodeIS13 = correct.NodeI
)
func printListStudent1(n *NodeI13) string {
var res string

6
go/tests/prog/sortlistinsert_test/main.go

@ -10,8 +10,10 @@ import (
"github.com/01-edu/public/go/tests/lib"
)
type NodeI14 = student.NodeI
type NodeIS14 = correct.NodeI
type (
NodeI14 = student.NodeI
NodeIS14 = correct.NodeI
)
func listToStringStu3(n *NodeI14) string {
var res string

6
go/tests/prog/split_test/main.go

@ -10,14 +10,16 @@ import (
)
func main() {
separators := []string{"!=HA=!",
separators := []string{
"!=HA=!",
"!==!",
" ",
"|=choumi=|",
"|<=>|",
lib.RandStr(3, lib.RuneRange('A', 'Z')),
"<<==123==>>",
"[<>abc<>]"}
"[<>abc<>]",
}
type node struct {
s string

10
go/tests/prog/tetrisoptimizer_prog/validation.go

@ -1,9 +1,11 @@
package main
const blockSize = 20
const dot = '.'
const hashTag = '#'
const newLine = '\n'
const (
blockSize = 20
dot = '.'
hashTag = '#'
newLine = '\n'
)
func isValidBlock(data []byte) bool {
numDots, numHashtags := 0, 0

1
go/tests/prog/ztail_prog/main.go

@ -21,6 +21,7 @@ func notNil(err error) bool {
}
return false
}
func main() {
var bytes int64
flag.Int64Var(&bytes, "c", 0, "output the last NUM bytes")

Loading…
Cancel
Save