Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of memset #35

Open
APTXASZC opened this issue Jun 30, 2024 · 0 comments
Open

usage of memset #35

APTXASZC opened this issue Jun 30, 2024 · 0 comments

Comments

@APTXASZC
Copy link

APTXASZC commented Jun 30, 2024

void remove_line()
{
  for (int row = y; row <= y + NUM(r, 18); row++)
  {
    c = 1;
    for (int i = 0; i < 10; i++)
    {
      c *= board[row][i];
    }
    if (!c)
    {
      continue;
    }
    for (int i = row - 1; i > 0; i--) 
    {
      memcpy(&board[i + 1][0], &board[i][0], 40);
    }
    memset(&board[0][0], 0, 10);  // **# I feel like it should be 40**
    score++;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant