Skip to content

Commit

Permalink
support to load even number boardsize
Browse files Browse the repository at this point in the history
  • Loading branch information
FutaAlice committed Apr 15, 2018
1 parent 256959e commit ee77f46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/fhcore/hexutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ uint8_t xy2gamlocate(int row, int col, int size)

tuple<int, int> gamlocate2xy(int gamlocate, int size)
{
if (size > 11 || size % 2 == 0)
if (size > 11)
throw;
for (int row = 0; row < size; ++row)
{
Expand Down
3 changes: 1 addition & 2 deletions src/fhcore/record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ bool Record::from_gam(unsigned char *gam_buffer, size_t gam_size)
size_t i = 0;
auto boardsize = gam_buffer[i++];
auto swap = 0 != gam_buffer[i++];
if (gam_size != 128 || boardsize % 2 == 0 ||
(swap != 0 && swap != 1))
if (gam_size != 128 || (swap != 0 && swap != 1))
return false;

clear();
Expand Down

0 comments on commit ee77f46

Please sign in to comment.