jwyatt1999 / CITS3403_Cartographers

CITS3403 Project - Josh Wyatt & Joo Kai Tay
0 stars 1 forks source link

Add Functionality to Allow Seeding the Pseudo-Random Number Generator #21

Closed jwyatt1999 closed 2 years ago

jwyatt1999 commented 2 years ago

In this PR I have replaced the existing pseudo-random number generator (which couldn't be seeded) with a new pseudo-random number generator that can be seeded. I have also added the functionality that allows us to start freeplay games and daily games (the primary difference being that they use different seeds).

jwyatt1999 commented 2 years ago

This is waiting on @Bsubs 's flask PR (from this branch https://github.com/jwyatt1999/CITS3403_Cartographers/tree/JooKai_Flask_App) to be merged, then I will change if (isDaily) { seed = xmur3(currentDate.getDate().toString() + currentDate.getMonth().toString() + currentDate.getYear().toString()); } in startGame(isDaily) to grab the current date from the flask server and convert that into a string (to prevent users from changing their local time to get a different seed).

jwyatt1999 commented 2 years ago

Hey @Bsubs , this is now ready for review. I've tested this locally and even when changing my computer's date it still gave the same date from the server.

Bsubs commented 2 years ago

Looks good :)