gol

Implementation of Conway's Game of Life writen in C
git clone git://git.dimitrijedobrota.com/gol.git
Log | Files | Refs | README |

commit3d5d4011210ae36eb7b810a61178674bd4b04278
parentd560d413c8fecd245e7c1ad6e38c8788b6621ab5
authorMateja Marsenic <matejamarsenic@gmail.com>
dateMon, 20 Jun 2022 06:50:28 +0200

Fixed minor spelling mistakes and few bugs regarding Doxygen

Diffstat:
Minclude/logic.h|++++++++++++++--
Msrc/logic.c|+++++++++++++-----

2 files changed, 27 insertions(+), 7 deletions(-)


diff --git a/include/logic.h b/include/logic.h

@@ -1,15 +1,27 @@

/**
* @file logic.h
* @author Mateja Marsenic
* @date 30 May 2022
* @brief This file contains functions and structures for logic.
*/
#ifndef LOGIC_H
#define LOGIC_H
#include "uthash.h"
#define MAX_SIZE 101
/**
* @brief structure that stores cells coordinates to use as a key in a hash
* map-uh;
*/
typedef struct Cell_cord {
int row;
int col;
} Cell_cord;
/**
* @brief sructure that stores a cell using hash map;
*/
typedef struct Cell {
Cell_cord cord;
unsigned char val;

diff --git a/src/logic.c b/src/logic.c

@@ -1,3 +1,10 @@

/**
* @file logic.c
* @author Mateja Marsenic
* @date 30 May 2022
* @brief This file contains functions used in games logic.
*/
#include <stdio.h>
#include <stdlib.h>

@@ -121,7 +128,7 @@ void doAdditions(void) {

}
/**
* @brief function responsible for calculation for a game mod called "Normal";
* @brief function responsible for calculation for a game mode called "Normal";
*/
void evolveNormal(void) {
Cell *c, *c_next;

@@ -142,7 +149,7 @@ void evolveNormal(void) {

}
/**
* @brief function responsible for calculation for a game mod called "CoExist";
* @brief function responsible for calculation for a game mode called "CoExist";
*/
void evolveCoExist(void) {
Cell *c, *c_next;

@@ -171,7 +178,8 @@ void evolveCoExist(void) {

}
/**
* @brief function responsible for calculation for a game mod called "Predator";
* @brief function responsible for calculation for a game mode called
* "Predator";
*/
void evolvePredator(void) {
Cell *c, *c_next;

@@ -209,7 +217,7 @@ void evolvePredator(void) {

}
/**
* @brief function responsible for calculation for a game mod called "Virus";
* @brief function responsible for calculation for a game mode called "Virus";
*/
void evolveVirus(void) {
Cell *c, *c_next;

@@ -247,7 +255,7 @@ void evolveVirus(void) {

}
/**
* @brief function responsible for calculation for a game mod called "Unknown";
* @brief function responsible for calculation for a game mode called "Unknown";
*/
void evolveUnknown(void) { // Assumption 3 ones and 3 twos result in 50/50
// chanse of 0 becoming one of them: