Tomas Hornik, Petr Coufal, Michal Musilek, Stepan Hubalovsky



A Solution of the Mastermind Board Game in Scratch Suitable for Education - Results of the Preliminary Case Study

pdf PDF


The article is a case study of a specific problem - popular board game Mastermind and its solution in Scratch, visual online programming language. A preliminary version of this paper was presented at APSAC 2017. Emphasis is put on the educational perspective both in the logic behind the solution itself and on the way the problem can be presented to elementary school pupils. The article is focused on logical explanation of the solution and on work with several specific programming elements, like IF-ELSE conditions, data structures and simple bug hunting feature. The difficulty is suitable for elementary school pupils as a complex task meant for superior individuals or a group of pupils. It was successfully tested as a small scale preliminary study conducted on pupils aged between 12 and 15 at an extracurricular group. The results of the qualitative research are presented at the end of this paper.


Algorithmic Thinking, Algorithm Development, Education, Elementary School, Mastermind Game Solution, Programming, Scratch, Educational Programming Languages


[1] Musílek, M.: Kapitoly z dějin informatiky. Gaudeamus, Hradec Kralove. ISBN 978-80- 7435-129-7. (2011)

[2] Mastermind Rules, http://www.pressmantoy.com/gamerules/ Mastermind_rules.pdf

[3] Stuckman, J. and Zhang, G.Q.: Mastermind is NP-Complete. (2006)

[4] Goodritch, Michael T.: On the algorithmic complexity of the Mastermind game with black-peg results. In: Information Processing Letters 109 675–678. (2009)

[5] Temporel, A., Kovacs, T.: A heuristic hill climbing algorithm for Mastermind. In: UKCI’03: Proceedings of the 2003 UK Workshop on Computational Intelligence, Bristol, United Kingdom, pp. 189-196. (2003)

[6] Kohoutek, R.: Kognitivní vývoj dětí a školní vzdělávání. In: Pedagogická orientace, 2008. Vol. 18 No. 3, pp. 3--22. ISSN 1805-9511. (2008)

[7] Rossing, Jonathan P., Miller, Willie M., Cecil, Amanda K. and Stamper Suzan E.: iLearning: The future of higher education? Student perceptions on learning with mobile tablets. In: Journal of the Scholarship of Teaching and Learning, Vol. 12, No. 2, June 2012, pp. 1--26. ISSN 1527-9316. (2012)

[8] Scratch 3.0. In: Scratch Wiki.

[online]. Accessed 17 Jun. 2017. Available at: https://wiki.scratch.mit.edu/wiki/Scratch_3.0 (2017)

[9] Ganesh, S. G.: Joy of Programming: Bug Hunt.

[online]. Accessed 17 Jun. 2017. Available at: http://opensourceforu.com/2011/03/joy-ofprogramming- bug-hunt/ (2017)

[10] Hidden Features: Turbo Mode. In: Scratch Wiki.

[online]. Accessed 13 Jun. 2017. Available at: https://wiki.scratch.mit.edu/wiki/Hidden_Featu res#Turbo_Mode (2017)

[11] Milková, E., Petránek, K.: Programming courses reflecting students' aptitude testing and implementing learning style preferences research results. In: International Journal of Mathematics and Computer in Simulation, vol. 10, 2016, pp. 218–225. ISSN: 2074-1316. (2016)

Cite this paper

Tomas Hornik, Petr Coufal, Michal Musilek, Stepan Hubalovsky. (2017) A Solution of the Mastermind Board Game in Scratch Suitable for Education - Results of the Preliminary Case Study. International Journal of Computers, 2, 214-219


Copyright © 2017 Author(s) retain the copyright of this article.
This article is published under the terms of the Creative Commons Attribution License 4.0