itaditya / trick-or-treat-game

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

Use query param to specify board size. #51

Closed itaditya closed 4 years ago

itaditya commented 4 years ago

Currently the board size if fixed to 10x10 grid. Let user specify the board size via url query params like ?size=8.

The upper limit of size should be 10 and the lower limit should be 4.

To calculate the final number of moves to display on scoreboard use this formula

final_moves = moves * (11 - board_size).

Reason- a 4x4 board can be solved in very few moves, so to make it fair for other people who played on 10x10 board.

devTeaa commented 4 years ago

This looks fun, I'll be working on this one

devTeaa commented 4 years ago

Would you like to show an error message if the query value is above 10?

itaditya commented 4 years ago

@devTeaa no if the value is above 10, we then take 10 as value.

devTeaa commented 4 years ago

@itaditya I'm guessing @acagastya will work on this? Or this is still open?

acagastya commented 4 years ago

@devTeaa I submitted a PR (#55), but I am still not sure why final_moves = moves * board_size. Wouldn't that be injustice for those who had the largest board? Well, I have added boardSize in the state if someone wants to grow from it.

itaditya commented 4 years ago

The issue is not assigned to anyone yet, so feel free to work on the code. You all can work on this together as well. GitHub has a co-author feature.

@acagastya you are right, updated the formula in Issue Description. Also next time please comment on the Issue before starting working on PR like @devTeaa did.

acagastya commented 4 years ago

55 Done, and done. Should be all right to use. Cheers.