Published: 2026-04-20
Application of the Linear Congruential Generator Method in a Number-Guessing Game
DOI: 10.35870/ijsecs.v6i1.7158
Efani Desi
- Efani Desi: Potensi Utama University
Article Metrics
- Scopus Citations
- Google Scholar
- Crossref Citations
- Semantic Scholar
- DataCite Metrics
-
If the link doesn't work, copy the DOI or article title for manual search (API Maintenance).
Abstract
Number guessing games occupy a deceptively simple position in the landscape of interactive software — easy to play, yet dependent on a mechanism that most players never think about: the quality of the number being generated. If that number is predictable, the game collapses. If it is genuinely unpredictable, the experience holds. This study applies the Linear Congruential Generator (LCG) method as the core algorithm for random number generation in a number-guessing game operating within the range of 1 to 100. LCG was selected not because it is the most statistically sophisticated option available, but because its computational simplicity and deterministic structure make it well-suited to lightweight game applications where speed and transparency of implementation matter more than cryptographic strength. Four parameters govern the algorithm's behavior — modulus, multiplier, increment, and seed — and each was configured deliberately to produce a distribution that remains acceptably uniform across repeated sessions. The seed value, generated dynamically at runtime, ensures that no two sessions begin from the same starting point, which is the primary mechanism for maintaining unpredictability from the player's perspective. Test results indicate that the application performs adequately: number distribution is reasonably balanced, the interface responds correctly to valid and invalid inputs, and the overall gameplay experience is fair. A more critical reading of the results, however, reveals that LCG carries inherent trade-offs — its period is finite, and under certain parameter configurations, detectable patterns can emerge in the generated sequence. For a single-player guessing game, these limitations are largely inconsequential. For applications requiring stronger statistical guarantees, they would not be. The application was built using Python with a graphical interface constructed through the tkinter library, making it accessible to users without any technical background. This study is intended as a practical reference for developers building number-based games and as a modest contribution to the applied literature on pseudo-random number generation in educational software.
Keywords
Random Number Generator; LCG; Number Guessing; Game; Python
Peer Review Process
This article has undergone a double-blind peer review process to ensure quality and impartiality.
Indexing Information
Discover where this journal is indexed at our indexing page.
Open Science Badges
This journal supports transparency in research and encourages authors to meet criteria for Open Science Badges.
How to Cite
Article Information
This article has been peer-reviewed and published in the International Journal Software Engineering and Computer Science (IJSECS). The content is available under the terms of the Creative Commons Attribution 4.0 International License.
-
Issue: Vol. 6 No. 1 (2026)
-
Section: Articles
-
Published: 2026-04-20
-
License: CC BY 4.0
-
Copyright: © 2026 Authors
-
DOI: 10.35870/ijsecs.v6i1.7158
AI Research Hub
This article is indexed and available through various AI-powered research tools and citation platforms. Our AI Research Hub ensures that scholarly work is discoverable, accessible, and easily integrated into the global research ecosystem.
-
Avdović, A. (2023). Extension of Linear Congruential Generator. Scientific Publications of the State University of Novi Pazar Series A: Applied Mathematics, Informatics and Mechanics, 15(2), 87–95. https://doi.org/10.46793/spsunp2302.087a
-
Bouras, A. (2024). Integrating randomness in large language models: A Linear Congruential Generator approach for generating clinically relevant content (pp. 1–13). arXiv. https://arxiv.org/abs/2407.03582
-
-
Fahrezi, G. R., Sakti, D. V. S. Y., & Muhardi, H. (2023). Implementasi Pseudo Random Number Generator (PRNG) dengan algoritma Linear Congruential Generator (LCG) pada permainan mengetik bertema Candi Prambanan. Jurnal Edukasi dan Penelitian Informatika, 9(2), 299. https://doi.org/10.26418/jp.v9i2.64713
-
-
Faure, E., Fedorov, E., Myronets, I., & Sysoienko, S. (2022). Method for generating pseudorandom sequence of permutations based on Linear Congruential Generator. CEUR Workshop Proceedings, 3137, 175–185. https://doi.org/10.32782/cmis/3137-15
-
Gunadi, H. (2023). Aplikasi ujian online untuk SMA PKP JIS dengan metode Linear Congruential Generator (LCG) berbasis web. Jurnal KLIK, 4(2), 815–828. https://doi.org/10.30865/klik.v4i2.1175
-
Hameedi, B. A., Hattab, A. A., & Laftah, M. M. (2022). A pseudo-random number generator based on new hybrid LFSR and LCG algorithm. Iraqi Journal of Science, 63(5), 2230–2242. https://doi.org/10.24996/ijs.2022.63.5.35
-
Khan, S. S., Palmer, B., Edelmaier, C., & Aktulga, H. M. (2024). OpenRAND: A performance portable, reproducible random number generation library for parallel computations. SoftwareX, 27, 101773. https://doi.org/10.1016/j.softx.2024.101773
-
Luis Crespo, J., González-Villa, J., Gutiérrez, J., & Valle, A. (2024). Assessing the quality of random number generators through neural networks. Machine Learning: Science and Technology, 5(2). https://doi.org/10.1088/2632-2153/ad56fb
-
-
Pandit, K. (2019). Linear congruential generator and caesar cipher. International Journal of Engineering and Advanced Technology, 9(1), 2248–2250. https://doi.org/10.35940/ijeat.A9731.109119
-
Perbawa, K. A., & Diana, D. (2022). Application of Linear Congruential Generator (LCG) algorithm in Android based mathematics education game. Jurnal Komputer, Informasi dan Teknologi, 2(1), 47–56. https://doi.org/10.53697/jkomitek.v2i1.599
-
-
Riis, S. (2026). Term coding: An entropic framework for extremal combinatorics and the guessing-number sandwich theorem. arXiv. https://arxiv.org/abs/2601.16614
-
Safitri, D. N. (2021). Implementasi metode Linear Congruential Generator pada game puzzle kesenian tari. JATISI (Jurnal Teknik Informatika dan Sistem Informasi), 8(1), 129–140. https://doi.org/10.35957/jatisi.v8i1.632
-
Soto-León, V., Arco, J. M., Martínez-Pérez, M. Á., Oliviero, A., & Aguilar, J. (2023). Effects of transcranial static magnetic field stimulation over the left dorsolateral prefrontal cortex on random number generation. Clinical Neurophysiology, 149, 18–24. https://doi.org/10.1016/j.clinph.2023.02.163
-
Sumiah, A., & Hakim, R. R. (2021). Implementasi metode Linear Congruential Generator pada game puzzle berbasis Android. JEJARING (Jurnal Teknologi dan Manajemen Informatika), 8(1), 129–140. https://doi.org/10.35957/jatisi.v8i1.632
-
Triwibowo, D. N., Purwono, Ashari, I. A., Sandi, A. S., & Rahman, Y. F. (2021). Enkripsi pesan menggunakan algoritma Linear Congruential Generator (LCG) dan konversi kode Morse. Buletin Ilmiah Sarjana Teknik Elektro, 3(3), 194–201. https://doi.org/10.12928/biste.v3i3.5546
-
Wardana, S. C. P., & Sabrina, S. S. J. N. (2025). Game tebak angka multipemain dengan penilaian skor otomatis menggunakan bahasa C++. Jurnal Komputasi dan Pengembangan Aplikasi, 1(3), 22–29. https://journals.arces.org/jukompak/.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
1. Copyright Retention and Open Access License
Authors retain copyright of their work and grant the journal non-exclusive right of first publication under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
This license allows unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
2. Rights Granted Under CC BY 4.0
Under this license, readers are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, including commercial use
- No additional restrictions — the licensor cannot revoke these freedoms as long as license terms are followed
3. Attribution Requirements
All uses must include:
- Proper citation of the original work
- Link to the Creative Commons license
- Indication if changes were made to the original work
- No suggestion that the licensor endorses the user or their use
4. Additional Distribution Rights
Authors may:
- Deposit the published version in institutional repositories
- Share through academic social networks
- Include in books, monographs, or other publications
- Post on personal or institutional websites
Requirement: All additional distributions must maintain the CC BY 4.0 license and proper attribution.
5. Self-Archiving and Pre-Print Sharing
Authors are encouraged to:
- Share pre-prints and post-prints online
- Deposit in subject-specific repositories (e.g., arXiv, bioRxiv)
- Engage in scholarly communication throughout the publication process
6. Open Access Commitment
This journal provides immediate open access to all content, supporting the global exchange of knowledge without financial, legal, or technical barriers.