feat: Aufgaben a-01 bis a-03 und b-04 bis b-06
Aufgaben unter tasks/ mit prompt.md, task.toml, start/ und check.sh. Musterlösungen bestehen die Checks, eine leere Lösung scheitert. b-06 erkennt fünf Mutationen; behoben: veralteter Bytecode in Mutantenkopien. Echter Lauf mit qwen3:0.6b auf srv04: 0 von 6 bestanden. Ein Repo-Test prüft die Gültigkeit der Aufgaben. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
20
tasks/B/b-04/check.sh
Executable file
20
tasks/B/b-04/check.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Prüft fib gegen die Spezifikation mit festen Testfällen.
|
||||
mkdir -p /checks
|
||||
cat > /checks/test_fib.py <<'PY'
|
||||
import sys
|
||||
sys.path.insert(0, "/work")
|
||||
import pytest
|
||||
from mathe import fib
|
||||
|
||||
def test_werte():
|
||||
assert [fib(n) for n in range(10)] == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
|
||||
|
||||
def test_gross():
|
||||
assert fib(90) == 2880067194370816120
|
||||
|
||||
def test_negativ():
|
||||
with pytest.raises(ValueError):
|
||||
fib(-1)
|
||||
PY
|
||||
cd /work && python3 -m pytest -q -p no:cacheprovider /checks/test_fib.py
|
||||
3
tasks/B/b-04/prompt.md
Normal file
3
tasks/B/b-04/prompt.md
Normal file
@ -0,0 +1,3 @@
|
||||
In /work liegt mathe.py mit einer leeren Funktion fib(n).
|
||||
Spezifikation: fib(n) gibt die n-te Fibonacci-Zahl zurück, mit fib(0) = 0 und fib(1) = 1. Für n < 0 wirft sie ValueError. Für große n (etwa 90) soll sie schnell sein.
|
||||
Implementiere fib in mathe.py. Ändere nichts anderes. Rufe danach done auf.
|
||||
2
tasks/B/b-04/start/mathe.py
Normal file
2
tasks/B/b-04/start/mathe.py
Normal file
@ -0,0 +1,2 @@
|
||||
def fib(n):
|
||||
raise NotImplementedError
|
||||
6
tasks/B/b-04/task.toml
Normal file
6
tasks/B/b-04/task.toml
Normal file
@ -0,0 +1,6 @@
|
||||
id = "b-04"
|
||||
title = "Funktion nach Spezifikation schreiben"
|
||||
group = "B"
|
||||
image = "cb-python:latest"
|
||||
max_steps = 20
|
||||
timeout_s = 480
|
||||
Reference in New Issue
Block a user