Browse Source

Convert last "prog" exercises as functions exercises (the end ?)

pull/533/head
Xavier Petit 4 years ago committed by xpetit
parent
commit
d7e4cfd33b
  1. 2
      docs/addition_of_exercise_draft.md
  2. 3
      subjects/brainfuck.en.md
  3. 0
      subjects/doppelganger.en.md
  4. 0
      subjects/findprevprime.en.md
  5. 7
      tests/go/solutions/brainfuck/main.go
  6. 2
      tests/go/test_doppelganger.go
  7. 10
      tests/go/test_raid3.go
  8. 4
      tests/go/test_ztail.go

2
docs/addition_of_exercise_draft.md

@ -1,5 +1,7 @@
# THE ADDITION OF EXERCISE PROCEDURE
**Needs to be updated since the refactor**
##### This is for a go exercise in the piscine-go
## **1. Writing the subject and / or writing the solution**

3
subjects/brainfuck.en.md

@ -29,7 +29,6 @@ student@ubuntu:~/[[ROOT]]/brainfuck$ ./brainfuck "+++++[>++++[>++++H>+++++i<<-]>
Hi$
student@ubuntu:~/[[ROOT]]/brainfuck$ ./brainfuck "++++++++++[>++++++++++>++++++++++>++++++++++<<<-]>---.>--.>-.>++++++++++." | cat -e
abc$
student@ubuntu:~/[[ROOT]]/brainfuck$ ./brainfuck | cat -e
$
student@ubuntu:~/[[ROOT]]/brainfuck$ ./brainfuck
student@ubuntu:~/[[ROOT]]/brainfuck$
```

0
subjects/doppelgangerprog.en.md → subjects/doppelganger.en.md

0
subjects/findprevprimeprog.en.md → subjects/findprevprime.en.md

7
tests/go/solutions/brainfuck/main.go

@ -9,7 +9,9 @@ import (
const SIZE = 2048
func main() {
if len(os.Args) == 2 {
if len(os.Args) != 2 {
return
}
progpoint := []byte(os.Args[1])
var arby [SIZE]byte
pos := 0
@ -62,7 +64,4 @@ func main() {
}
i++
}
} else {
z01.PrintRune('\n')
}
}

2
tests/go/test_doppelganger.go

@ -48,6 +48,6 @@ func main() {
}
for _, arg := range table {
z01.Challenge("DoppelGangerProg", student.DoppelGanger, correct.DoppelGanger, arg.big, arg.little)
z01.Challenge("DoppelGanger", student.DoppelGanger, correct.DoppelGanger, arg.big, arg.little)
}
}

10
tests/go/test_raid3.go

@ -37,11 +37,11 @@ func main() {
// builds all the files for testing, student, solution and relevant files
execFatal("go", "build", "-o", "raid3", "solutions/raid3/main.go")
execFatal("go", "build", "-o", "raid3_student", "student/raid3/main.go")
execFatal("go", "build", "solutions/raid3/raid1aProg/raid1a.go")
execFatal("go", "build", "solutions/raid3/raid1bProg/raid1b.go")
execFatal("go", "build", "solutions/raid3/raid1cProg/raid1c.go")
execFatal("go", "build", "solutions/raid3/raid1dProg/raid1d.go")
execFatal("go", "build", "solutions/raid3/raid1eProg/raid1e.go")
execFatal("go", "build", "solutions/raid3/raid1aprog/raid1a.go")
execFatal("go", "build", "solutions/raid3/raid1bprog/raid1b.go")
execFatal("go", "build", "solutions/raid3/raid1cprog/raid1c.go")
execFatal("go", "build", "solutions/raid3/raid1dprog/raid1d.go")
execFatal("go", "build", "solutions/raid3/raid1eprog/raid1e.go")
// testing all raids1
table := []string{"raid1a", "raid1b", "raid1c", "raid1d", "raid1e"}

4
tests/go/test_ztail.go

@ -31,4 +31,6 @@ func main() {
}
}
// TODO: never use programs we didn't wrote (do not run the true cat but instead code our own solution)
// TODO:
// never use programs we didn't wrote (do not run the true cat but instead code our own solution)
// to be fixed

Loading…
Cancel
Save