vandamm / 30-rails

React implementation of "30 Rails" board game
MIT License
0 stars 1 forks source link

Incorrect calculation of scoring #6

Open frudolph77 opened 4 years ago

frudolph77 commented 4 years ago

Hey, I just discovered your implementation of 30 rails. I would like to implement this game by my own, but had no idea how to automatically calculate the scoring. During testing I found a bug in your code.

The problem exist with the tiles 5 and 6

Tile 5           Tile6          Matrix
[2, 4],          [1, 4],        [0, 1, 0],
[3, 4]           [3, 4]         [2, 0, 3],
                                [0, 4, 0]

Based on the rules the connections on Tile 5 are

in out comment
2 4 valid
3 4 valid
4 2 valid
4 3 valid
2 3 invalid, but detected as connection Update: What I forget to mention the tile counts twice in that case.

Due to the rules you are not allowed to pass a tile twice on the same track. On detecting the routes a tile can only be passed once, except for tile 3 and 4 which have two unjoined tracks. The tracks on the tiles 5 and 6 are joined in point '4'.

vandamm commented 4 years ago

Hi @frudolph77, thanks for your comment! It's quite unusual that somebody took interest in this project as it was made solely to practice some React :)

I'll take a look at this when I can, which unfortunately can be in quite some time because of lack of free time now.

frudolph77 commented 4 years ago

Hi Alexander,

Hi @frudolph77, thanks for your comment! It's quite unusual that somebody took interest in this project as it was made solely to practice some React :) You're welcome, I just digged through GitHub to look if somebody has implemented this game. I found two JS/TS implementations and yours was more interesting because of the automated calculation of the scoring. I just want to practice some React to. I'm really interested in the automated scoring calculation.

I'll take a look at this when I can, which unfortunately can be in quite some time because of lack of free time now. This is absolutely no problem.

What I forget to mention, is that only one connection to a mine is detected and that the bonus info, see my pull request, gets lost and so there is no scoring of this.

I try to understand your code and maybe find a way to fix some issues.

Greets Frank