Chess-Coding-Adventure
Chess-Coding-Adventure copied to clipboard
Stats and last move on board shows from last game at the start of a new one.
You can see the stats for the previous game when you hit the button of a new game. May be a pretty easy fix, idk
In the image, it seems that the squares of the last move are highlighted too
Cool project, I took a quick look - seems like a one-liner code change would fix the stale stats (moving to NewGame which is called from the main flow).
You can take the change from here: https://github.com/SebLague/Chess-AI/pull/2
One suggestion: Write a test for this scenario.
Writing a test for each bug:
- You immediately know when you fixed the issue because the test passes.
- The bug will never happen again because you have a test to cover the scenario.
- It provides you with an automated way to reproduce the bug.
- You can't know that you have fixed the bug without being able to reproduce it.
- If you make a mistake in following the steps to reproducing the bug then you might assume that you have fixed the bug, even though the bug is still there. What happened was a double mistake (the bug and the mistake in the repro steps canceled each other out).
- The automated test never makes a mistake in following the repro steps. Writing one and using it is a way to know for sure that you have fixed the issue.
I'll see if I can put together a pull request for an automated test.
As @gel said, cool project!
Hey everyone, check out my fix on this one