I'm trying to know what number the computer will randomly choose. Will I need a specific algorithm? Or do I need artificial intelligence?
You can't predict a true random number, by definition, as it is random. Pseudorandom numbers can be predicted if you know both the algorithm being used and the seed number being provided.
https://www.howtogeek.com/183051/htg-explains-how-computers-generate-random-numbers/
Here's a good article on the different methods of generating random numbers.
so is it possible to know the seed or the algorithm ?
@osamasyr Technically yes. v8.dev/blog/math-random to see some info on JavaScript implementation of Math.random(). If you're using a library you could check the source code to see their implementation. If reading source code isn't an option, my answer would be it is mathematically possible, but I wouldn't have a clue where to start.