twelve-of-code-official / website

The source code for the Twelve of Code website
https://mesure.x10.mx/twelve-of-code
GNU General Public License v3.0
0 stars 0 forks source link

SeedManager Class #162

Closed BeepBot99 closed 6 months ago

BeepBot99 commented 6 months ago

Issue Contents

@Mesure73L I have created a SeedManager class. It works as follows, on a per challenge basis. This means that for each challenge, you have a seperate instance of SeedManager. Here is an example that will hopefully show you how it works:

const sman /*superman maybe???*/ = new SeedManager(
  029340, // seed
  ["appleType", "pearType"] // names of random values needed for the challenge
);

Then, you can access things like sman.appleType and sman.pearType. Each is a random number in between 0 and 1, just like random numbers generated by Math.random(). However, it will be the same every time for a given seed. For example, with the seed 029340, sman.appleType and sman.pearType will be the same every time, but they will be a different pseudorandom number if it is a different seed.

Here is my question:

Can I please make the seed able to be any string? I have a hash function to convert it to a number. That way, it would give the user more customizability.

Mesure73L commented 6 months ago

Can I please make the seed able to be any string? I have a hash function to convert it to a number. That way, it would give the user more customizability.

Why do you need that

BeepBot99 commented 6 months ago

I don't, it would just be nice. Also, why can't it start with a 0? You understand like no group theory.

Mesure73L commented 6 months ago

The seed is a number between 1000000000-9999999999

BeepBot99 commented 6 months ago

I know, why not 0?

BeepBot99 commented 6 months ago

And why not any string?

Mesure73L commented 6 months ago

I know, why not 0?

Fine

And why not any string?

BECAUSE NUMBER ≠ TEXT

BeepBot99 commented 6 months ago

Yeah, I'm saying what's the problem with making it so it can accept text?

BeepBot99 commented 6 months ago

You can easily do that by using a good hashing function.

Mesure73L commented 6 months ago

No text

BeepBot99 commented 6 months ago

Yes, I'm asking why.

Mesure73L commented 6 months ago

Because i dont want it

BeepBot99 commented 6 months ago

Pros of having a hashing function

If you can't give me an actual, good reason for why you don't want it, other than that you don't want it, then I am going to add it in my next commit.

Mesure73L commented 6 months ago

fine

Mesure73L commented 6 months ago

If you can't give me an actual, good reason for why you don't want it, other than that you don't want it, then I am going to add it in my next commit.

But jsyk you are not allowed to say that under any circumstances.

BeepBot99 commented 6 months ago

No, I'm asking for a valid reason. If you're just going to completely ignore me without any valid reasoning, then I am going to do it.

BeepBot99 commented 6 months ago

And if you're not going to give me a valid reason, I don't care what you say then.

Mesure73L commented 6 months ago

You are still not allowed to say that, this is supposed to be constructive not forced.

Mesure73L commented 6 months ago

fine

and did you even read what was before that?

BeepBot99 commented 6 months ago

You are still not allowed to say that, this is supposed to be constructive not forced.

Yes, so if you are not going to provide any valid reasoning, I am going to say it.

Mesure73L commented 6 months ago

fine

and did you even read what was before that?

.

Mesure73L commented 6 months ago

You're so focused on arguing you don't even realize I accepted the suggestion LMAO

BeepBot99 commented 6 months ago

I did realize.

Mesure73L commented 6 months ago

X for I agree!

BeepBot99 commented 6 months ago

Thank you!

Mesure73L commented 6 months ago

Exactly, you are agreeing to me saying that I disagree with you. wait-