
–
The game Minecraft depicts a world created from cubes, where everything is built with blocks. Although calculating the value of Pi through this video game may seem unlikely, researchers have discovered that it is, in fact, possible.
In the game, players can freely move around the world and construct various structures such as buildings or circuits using cube-shaped elements. To do this, you need to collect resources and transform them into new items.
According to , if any computer program can be implemented in Minecraft, then it is also possible to implement one that is capable of calculating the value of Pi. However, translating an algorithm to a video game is a complex process, as it involves converting all the electrical instructions executed by a computer into actions within the game.
These operations include clearing records, inserting new values, and processing data through logical operations, such as AND operation applied to registers x and y.
In a study published in 2024, researchers presented several methods for calculating known mathematical constants within the popular video game. To calculate Pi in a relatively simple way to implement in Minecraft, they chose the so-called “two dart method”.
The researchers began by constructing an approximation of a circle in the game, using red blocks with a “radius” of 11 blocks. Then, they surrounded this circle with blue blocks, forming a blue square circle around the red circle.
So they created random events that simulated darts hitting a target. To do this, they turned to a video game creature known as a “slime”. Unlike many other creatures in the game, slimes keep moving even when there are no players around and randomly change their direction.
Slimes were paired with another type of creature, the “zoglin”, which automatically eliminates them.
With these two creatures, scientists were able to generate random events that could be monitored without the need for direct observation. By covering the red circle with funnel-shaped blocks, called “hoppers“, which automatically collect objects dropped on them, created a system capable of recording whenever a slime died within the defined area.
By dividing the number of slimes killed within the circle by the total number of slimes killed, it is possible to get an approximation of Pi/4.
The two researchers tested their method in the game. During the test, 619 slimes were killed508 of whom were killed within the circle.
Finally, this is not a good approximation of Piso you must increase the area of the square, and consequently the area of the circle, and increase the number of dead slimes within that total area. Enlarge the circle improves accuracygetting closer to a true circle. And the technique of darts becomes more precise when they are generated more random events.