The teaching of sorting algorithms is an essential topic in undergraduate computing courses. Typically the courses are taught through traditional lectures and exercises involving the implementation of the algorithms. As an alternative, this article presents the design and evaluation of three educational games for teaching Quicksort and Heapsort. The games have been evaluated in a series of case studies, including 23 applications of the games in data structures courses at the Federal University of Santa Catarina with the participation of a total of 371 students. The results provide a first indication that such educational games can contribute positively to the learning outcome on teaching sorting algorithms, supporting the students to achieve learning on higher levels as well as to increase the students' motivation on this topic. The social interaction the games promote allows the students to cooperate or compete while playing, making learning more fun.