In algorithm learning, it is necessary to read the example code of the algorithm. However, code reading lacks a clear termination condition, so there are two problems: 1) learners tend to end learning with insufficient understanding and 2) it is difficult for learners to maintain their motivation for learning. As an alternative to code reading, herein we propose a method to read and fix code containing bugs. We created a system and recruited 40 subjects for the evaluation experiments. A group (fixing bugs to learn Tower of Hanoi) had significantly better test scores (p-value: 0.0332) compared to the other group (reading code to learn Sieve of Eratosthenes). However, when the two groups were combined and analyzed, no significant difference was found. Since a ceiling effect was observed from the confirmation questions of the Sieve of Eratosthenes and the overall score was higher for Group A, and there is a possibility of bias both between questions and between groups, more rigorous experiments should be conducted in the future.