Skip to content
/ cgol-c Public

Conway's Game of Life, for the terminal, written in C

License

Notifications You must be signed in to change notification settings

zsarge/cgol-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cgol-c

Conway's Game of Life, for the terminal, written in C


This is a near direct translation of my other implementation in Go.

I wrote this to see if switching to a non-gc'd language would make a significant performance impact.

Using the same logic in both programs, both Go and unoptimized C have roughly equivalent performance on my system.

However, compiling with the -O3 flag causes the C version to significantly outperform Go.

I have not taken many steps towards optimization. If you are interested in optimizing Conway's Game of Life, I recommend looking into HashLife or this StackOverflow thread.


gcc main.c -o a.out && ./a.out =


+--------------------------------------------------------------------------------+
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|     X                                                                          |
|      X                                                                         |
|    XXX                                                                         |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+


... and so on

About

Conway's Game of Life, for the terminal, written in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages