<commit_before>#include "ledtable.h"

/*
 * We request that the point x=0, y=0 are inside.
 * Otherwise, height and width will not work.
 * 
 * use originalWidth() and originalHeight()
 */


void id(LEDTable* ledtable, int*x, int*y) 
{
}

void snake(LEDTable* ledtable, int*x, int*y) 
{
  if ((*y) & 1) {
    *x = ledtable->originalWidth() - *x - 1;
  }
}

void mirror_horizontally(LEDTable* ledtable, int*x, int*y) 
{
  *y = ledtable->originalHeight() - 1 - *y;
}

void mirror_vertically(LEDTable* ledtable, int*x, int*y) 
{
  *x = ledtable->originalHeight() - 1 - *x;
}

void rotate_90(LEDTable* ledtable, int*x, int*y) 
{
  int _x = *x;
  *x = ledtable->originalHeight() - *y; // todo: is that correct?
  *y = *x;
}

void rotate_180(LEDTable* ledtable, int*x, int*y) 
{
  int _x = *x;
  *x = ledtable->originalWidth() - *x - 1;
  *y = ledtable->originalHeight() - *y - 1;
}

void rotate_270(LEDTable* ledtable, int*x, int*y) 
{
  int _x = *x;
  *x = *y;
  *y = ledtable->originalWidth() - *x; // todo: is that correct?
}

void flip_xy(LEDTable* ledtable, int*x, int*y)
{
  int t = *x;
  *x = *y;
  *y = t;
}

<commit_msg>aadded comment about transformation requirements<commit_after>#include "ledtable.h"

/*
 * We suppose that (0,0) is inside and
 * either (originalHeight() - 1, originalWidth() - 1)
 *     or (originalWidth() - 1, originalHeight() - 1)
 * are inside.
 * 
 * use originalWidth() and originalHeight()
 */


void id(LEDTable* ledtable, int*x, int*y) 
{
}

void snake(LEDTable* ledtable, int*x, int*y) 
{
  if ((*y) & 1) {
    *x = ledtable->originalWidth() - *x - 1;
  }
}

void mirror_horizontally(LEDTable* ledtable, int*x, int*y) 
{
  *y = ledtable->originalHeight() - 1 - *y;
}

void mirror_vertically(LEDTable* ledtable, int*x, int*y) 
{
  *x = ledtable->originalHeight() - 1 - *x;
}

void rotate_90(LEDTable* ledtable, int*x, int*y) 
{
  int _x = *x;
  *x = ledtable->originalHeight() - *y; // todo: is that correct?
  *y = *x;
}

void rotate_180(LEDTable* ledtable, int*x, int*y) 
{
  int _x = *x;
  *x = ledtable->originalWidth() - *x - 1;
  *y = ledtable->originalHeight() - *y - 1;
}

void rotate_270(LEDTable* ledtable, int*x, int*y) 
{
  int _x = *x;
  *x = *y;
  *y = ledtable->originalWidth() - *x; // todo: is that correct?
}

void flip_xy(LEDTable* ledtable, int*x, int*y)
{
  int t = *x;
  *x = *y;
  *y = t;
}


{'fraction_non_alphanumeric': 0.18475947211579397, 'fraction_numerical': 0.01532567049808429, 'mean_word_length': 3.311926605504587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3093650', 'n_tokens_mistral': 1021, 'n_tokens_neox': 983, 'n_words': 245}