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

Update SeedManager to use bignumber.js #173

Closed BeepBot99 closed 5 months ago

BeepBot99 commented 5 months ago

Issue Contents

I just created SeedManager in PHP. It will be at the end of this issue. The problem is, it was giving slightly different answers than the JavaScript SeedManager was. After further investigation, I realized that the JavaScript was rounding the big numbers to the nearest thousand, while the PHP was not. Therefore, I want to implement bignumber.js into the JavaScript so that it stores the numbers as strings instead of numbers, so it will not round them. I am asking for permission to implement that into SeedManager in the twelve-of-code-official/challenges#2 branch. In case you may want it, here is the PHP for SeedManager:

<?php
$state = 1000000000; # Starting seed

function nextFloat() {
    global $state;
    $m = 0x80000000;
    $a = 1103515245;
    $c = 12345;
    $state = ($a * $state + $c) % $m;
    return $state / ($m - 1);
}
echo nextFloat(); # nextFloat() gives the next random number. The first time you call it should give the same number as the first item in the array for the JavaScript SeedManager.
BeepBot99 commented 5 months ago

TL;DR

The author created a PHP version of SeedManager, but it was found to produce slightly different results than the JavaScript version. The problem was identified to be the JavaScript version rounding the big numbers to the nearest thousand, while the PHP version was not. The author strongly recommends implementing bignumber.js into the JavaScript version to prevent the rounding of numbers and ensure consistency in the generated results.

Mesure73L commented 5 months ago

You are allowed to use the twelve-of-code-official/challenges#2 branch until tomorrow.

Mesure73L commented 5 months ago

The author created a PHP version of SeedManager, but it was found to produce slightly different results than the JavaScript version. The problem was identified to be the JavaScript version rounding the big numbers to the nearest thousand, while the PHP version was not. The author strongly recommends implementing bignumber.js into the JavaScript version to prevent the rounding of numbers and ensure consistency in the generated results.

bro that was chatgpt edited, only chatgpt would say "The author" and not "I" in this context

BeepBot99 commented 5 months ago

@Mesure73L Can I do this in branch twelve-of-code-official/challenges#2, or should I create a new branch from it?

Mesure73L commented 5 months ago

You can do this in branch 92.

BeepBot99 commented 5 months ago

Project Name: Use bignumber.js in Twelve of Code's SeedManager Date: 3/5/2024

Status: The project has not been started yet, but we plan to begin work today. We have reviewed all the project requirements and mapped out a plan of action.

Next Steps: The next step is to begin work on the project. We will start by gathering all the necessary resources, including any tools, equipment, or software required for the project. We will then allocate tasks and responsibilities to each team member, ensuring that everyone understands their role in the project.

Once we begin work, we will closely monitor progress, regularly checking in with team members to ensure that we are on track to meet our goals. We will also keep stakeholders informed of our progress, providing regular updates on key milestones and any challenges we encounter.

Overall, we are confident that we can complete the project on time and to a high standard. We have a strong team in place and are fully committed to delivering a successful outcome.

Thank you for your support and interest in this project.

Best regards,

@BeepBot99


To help my writing process, I used these Grammarly AI prompts:

Prompts created by Grammarly

Mesure73L commented 5 months ago

To help my writing process, I used these Grammarly AI prompts: Prompts created by Grammarly

  • "Write a project progress report"

yeah ik thats ai, im not reading it

Mesure73L commented 5 months ago

@BeepBot99 please actually do this instead of getting grammarly ai to write you a message about doing it

BeepBot99 commented 5 months ago

I'm literally doing it right now.

BeepBot99 commented 5 months ago

My console right now: image

BeepBot99 commented 5 months ago

@Mesure73L Can you please add a <script> tag for the not-an-api/libraries/bignumber/bignumber.js file in all of the challenge html files?

BeepBot99 commented 5 months ago

Done.

Mesure73L commented 5 months ago

@Mesure73L Can you please add a <script> tag for the not-an-api/libraries/bignumber/bignumber.js file in all of the challenge html files?

Do you still need me to do this?

BeepBot99 commented 5 months ago

Yes.

BeepBot99 commented 5 months ago

Make sure it is in the head.

Mesure73L commented 5 months ago

Why does it need to be in the head? Should I put it in the head with defer or not?

BeepBot99 commented 5 months ago

No, it is a library. No defer because it does not need to run any code immediately, only when the JavaScript calls it.

Mesure73L commented 5 months ago

Done.

BeepBot99 commented 5 months ago

Great, thank you!

Mesure73L commented 5 months ago

You're welcome! Thank you for saying thank you!

BeepBot99 commented 5 months ago

Thank you for saying you're welcome! Thank you for saying thank you for saying thank you! You're welcome for saying thank you!

Mesure73L commented 5 months ago

Thank you for saying thank you for saying you're welcome! Thank you for saying thank you for saying thank you for saying thank you! You're welcome for saying you're welcome! You're welcome for saying thank you for saying thank you for saying thank you! Thank you for saying you're welcome for saying thank you!

BeepBot99 commented 5 months ago

Thank you for saying thank you for saying thank you for saying you're welcome! Thank you for saying thank you for saying thank you for saying thank you for saying thank you! Thank you for saying you're welcome for saying you're welcome! Thank you for saying you're welcome for saying thank you for saying thank you for saying thank you! Thank you for saying thank you for saying you're welcome for saying thank you! You're welcome for saying thank you for saying you're welcome! You're welcome for saying thank you for saying thank you for saying thank you! You're welcome for saying you're welcome for saying thank you!

Mesure73L commented 5 months ago

ok im done with this

BeepBot99 commented 5 months ago

NOOOOOOOO.