Posts Tagged ‘Programming’

TicTacToe – C (procedural style)

This is a simple version of TicTacToe written in C. I wrote this primarily to help a friend of mine. It has virtually no error checking (primarily in regards to the scanf functions, so don’t mess up while inputting!) #include <stdio.h>   char board[3][3];   char turn = ‘X’;   void init(char board[3][3]); void draw(char [...]

BrainF*** (Programming Language) – minor varient

Earlier this year I was playing around with making simple programming languages and came across “BrainFuck”. I, being bored decided to write my own BrainFuck Interpreter and of course made a few changes along the way (only in I/O functions, added integer support since BrainFuck only deals with characters). If interested, I recommend reading more [...]

Simulation Program (Motivated by John Conway’s Game of Life) – C/C++

In this little simulation demo I created four simple rules, of which can be activated by uncommenting them out in the source code. Though nothing too complex emerges, I still liked some the resulting behavior. Particularly, rule1(), results in colors slowly grouping together in various forms. It may be hard to immediately noticed so watch [...]

C++ Dynamic Memory Allocation (2D and 3D)

This snipped of code is for allocating memory when using a multidimensional array. The following examples are for 2D ([][]) and 3D ([][][]) structures. First: to allocate memory for a two dimensional structure: (i.e. int[][] array) 1 2 3 4 5 6 7 8 9 int** array; // 2D array definition; // begin memory allocation [...]

SDL Sprite Class in C++

This is a simple Sprite class that I use for game development in C++ using SDL ( Features include sprite animation, rotation, stretching, transparencies, and other commonly used sprite functions. I hope this is somewhat useful. The source is available and should be fairly simple to work with. Feel free to modify it however you [...]

Powered by WordPress | Designed by: WordPress Themes | Thanks to best wordpress themes, Find WordPress Themes and Themes Directory