alanfortlink/blackjack.nvim

add randomseed

Closed this issue · 1 comments

if you don't use a different randomseed every time you generate random numbers they won't actually be random
you should add a math.randomseed(os.clock()) here

for i = 1, 52 do

you can test this out by doing a few :lua =math.random(52) and then restarting neovim and doing it again
the numbers will be the same

That should address the issue. I'm setting the seed for every new card deck. Thanks for the tip!