Skip to content

alexander-wiltz/zufall-am-computer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zufall-am-computer

coded and written by Alexander Wiltz, 2021

Implementation and simulation of a Bingo-Ball 75 game as part of a study project for the module stochastics for computer scientists

Entry

As part of a study project, I have written a code to play bingo in a very simple version. The Bingo.java creates a multidimensional matrix with 5x5 fields as an 2D-array, generate 20 (default) pseudo-random numbers with a mersenne-twister (seed: 2^19937 -1), set them in a hashset to be unique between the array, generate 5 more numbers with the same periodity in antoher hashset as the "conférencier" and compare the arrays. If there are the 5 numbers equal to five numbers in the cardset, the code try to find if the numbers are in a row, a colum or diagonal. When they are, the code throws a "BINGO"

Statics

The Bingo-Code is also ready to analyze the game. It write out where the win was, how many numbers are equal to the drawn numbers and throw a win-boolean.

Simulation-Class

There is also a CSimulator-Class to play the game automatically and take the information about the last situation. At the end of the iteration, there are methods to build a summary of all things like, equality-counter, wins, row-wins, column-wins, diagonal-wins and the sum of all games. There is a method to export the values in a csv via ICSVFileWriter which uses the OPEN-CSV Lib.

License

The code is for free-use only, not for commercial use! All rights reserved!

Sources

All used sources, documents and code-examples are placed in the whitepaper.

Sheets

The csv-Sheets are generated by the CSimulator-Class and are part of the paper.

Links

OpenCSV Example by mykong.com

OpenCSV Maven Repository

Apache Commons Repository (MersenneTwister)

Doc of JAVA random-Class

Doc of JAVA MersenneTwister-Class


Have a nice day

Alex