Skip to content
Snippets Groups Projects
Verified Commit f07d4a0c authored by Dorian Stoll's avatar Dorian Stoll
Browse files

zellularautomat: c: Remove unused RNG spinning

parent 76c7082b
No related branches found
No related tags found
No related merge requests found
......@@ -25,19 +25,10 @@ void ca_init(int argc, char** argv, int *lines, int *its)
}
/* random starting configuration */
void ca_init_config(line_t *buf, int lines, int skip_lines)
void ca_init_config(line_t *buf, int lines)
{
volatile int scratch;
srand(424243);
/* let the RNG spin for some rounds (used for distributed initialization) */
for (int y = 1; y <= skip_lines; y++) {
for (int x = 1; x <= XSIZE; x++) {
scratch = scratch + (rand() % 2);
}
}
for (int y = 1; y <= lines; y++) {
for (int x = 1; x <= XSIZE; x++) {
buf[y][x] = rand() % 2;
......
......@@ -25,7 +25,7 @@ typedef uint8_t cell_state_t;
typedef cell_state_t line_t[XSIZE + 2];
void ca_init(int argc, char** argv, int *lines, int *its);
void ca_init_config(line_t *buf, int lines, int skip_lines);
void ca_init_config(line_t *buf, int lines);
void ca_report(line_t *buf, int lines);
#ifdef __cplusplus
......
......@@ -75,7 +75,7 @@ int main(int argc, char** argv)
line_t *from = calloc((lines + 2), sizeof(line_t));
line_t *to = calloc((lines + 2), sizeof(line_t));
ca_init_config(from, lines, 0);
ca_init_config(from, lines);
for (int i = 0; i < its; i++) {
boundary(from, lines);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment