ulurn-av / Conways-Game

Conway's Game of Life. This repository include a DLL which can help you to make a "Game of Life".

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GifforGit

Dll for "Game of Life" GitHub license

Conway's Game of Life. This is repository includes a DLL which can help you to make a "Game of Life".

Contents

Ctor

  public GameLogic(int rows, int columns, int density = 2) {}

You can use ctor with 3 or 2 parameters without them you can't.

For exemple you can call ctor like that:

  static GameLogic gameLogic = new GameLogic
  (
      rows: Console.WindowHeight,
      columns: Console.WindowWidth,
      density: density
  );

Or without density.

Methods

  • Generation
  public void Generation() {}

Method is using without parameters, and using for build a next generation.

  • CountOfNeighbors
  private int CountOfNeighbors(int x, int y)

Method is using with 2 parameters, and using by method Generation for count of neighbors cell. Generally you won't use this method he is exist for Generation method.

  • GetGeneration
  public bool[,] GetGeneration()

GetGeneration is return an array bool[,]. This method using for getting a generation and then output it in Console or PictureBox in Windows Forms.

Download a Dll

About

Conway's Game of Life. This repository include a DLL which can help you to make a "Game of Life".

License:MIT License


Languages

Language:C# 100.0%