From b74c45278dfc4795f765751bf30e8fba95b8ab87 Mon Sep 17 00:00:00 2001 From: shunchaoyin Date: Sat, 6 Dec 2025 20:41:52 +0800 Subject: [PATCH 1/3] add a bug for testing bugbot. --- .../\346\240\210/Stack.cpp" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" "b/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" index 068d7d7..194d399 100644 --- "a/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" +++ "b/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" @@ -12,7 +12,7 @@ Stack::Stack() bool Stack::isEmpty() const { - return _top >= 0; + return _top >! 0; } bool Stack::isFull() const From 3ad4af57aa0aab8b8ca123e9bb6cf3c1ffcb9718 Mon Sep 17 00:00:00 2001 From: shunchaoyin Date: Sat, 6 Dec 2025 21:32:02 +0800 Subject: [PATCH 2/3] add a logic issue for bugbot. --- .../\346\240\210/Stack.cpp" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" "b/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" index 194d399..263cfa2 100644 --- "a/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" +++ "b/Algorithms/\347\272\277\346\200\247\347\273\223\346\236\204/\346\240\210/Stack.cpp" @@ -17,7 +17,7 @@ bool Stack::isEmpty() const bool Stack::isFull() const { - return _top >= STACK_CAPACITY - 1; + return _top <= STACK_CAPACITY - 1; } int Stack::size() const From 382ec13fe0297d9b2ae19080e7ffac3b8797b00b Mon Sep 17 00:00:00 2001 From: shunchaoyin Date: Sun, 7 Dec 2025 20:04:47 +0800 Subject: [PATCH 3/3] test the bugbot for python --- Algorithms/test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Algorithms/test.py diff --git a/Algorithms/test.py b/Algorithms/test.py new file mode 100644 index 0000000..09e6440 --- /dev/null +++ b/Algorithms/test.py @@ -0,0 +1,13 @@ +// write a function to sort a list of numbers in maopao sort +def maopao_sort(numbers): + for i in range(len(numbers)): + for j in range(len(numbers) - 1): + if numbers[j] > numbers[j + 1]: + numbers[j], numbers[j + 1] = numbers[j + 1], numbers[i] + return numbers + + +// test the function +numbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5] +print(maopao_sort(numbers)) + \ No newline at end of file