itaditya / trick-or-treat-game

Play it for free here
https://trick-or-treat.netlify.com/
16 stars 17 forks source link

Adding support for size in URL params #55

Closed acagastya closed 4 years ago

acagastya commented 4 years ago

As mentioned in #51

netlify[bot] commented 4 years ago

You can play this version of the game here

Built with commit 2fe3dd3996259cd08b243b015ff147a918418a34

https://deploy-preview-55--trick-or-treat.netlify.com

acagastya commented 4 years ago

Try by clicking this.

itaditya commented 4 years ago

@acagastya create a file named constants.js inside src/ directory. Inside that keep these constants

export const BOARD_SIZE_MIN = 4;
export const BOARD_SIZE_MAX = 10;

Also in the formula, instead of hardcoding 11, use this formula

final_moves = moves * (BOARD_SIZE_MAX + 1 - board_size)
acagastya commented 4 years ago

@itaditya Anything missing, or needs to be changed?

itaditya commented 4 years ago

@acagastya everything looks great. Can you fix the merge conflicts? I'll merge after it ASAP

acagastya commented 4 years ago

@itaditya Is the current build failing? These are the things I did:

  1. Resolved the conflicts and merged.
  2. Saw checks failing.
  3. Undid the last commit, and tried running it locally and failed.
  4. Cloned original repo and ran the start script, and it failed too.
itaditya commented 4 years ago

Hey @acagastya the build failing is related to some other code, your code is working fine and so I have merged. Thanks for working on this. It was a lot of work and I'm so glad you completed it.

acagastya commented 4 years ago

Oh, that sounds wonderful! I am glad I didn't break things beyond fixation. And I am thankful, I learned about how to extract parameters from the query. Thank you, @itaditya!