ChainReaction
Chain Reaction is a single device multiplayer game which did evolve with time to support multiple devices. It seemed simple but interesting which inspired me to code out the game. I implemented the basic logic and made a console game where user can play by giving co ordinates of the cell where he wants to give input. Its an exact working solution of that game just the UI and User control was inferior as it had to run on terminal and I had no knowledge of APP UI. Now lets see what it is.
Instructions
Compile and run using this command
$ gcc chainreaction.c
$ ./a.out
This game is written in C. I wish to make this as an App with a few tweaks to be able to play across multiple devices over the internet.
How to play
-
Its a multiplayer game (upto 6 players) with square grid play ground where each player has his own unique color (for my console game I used different symbols for each player like
*
,#
,$
,&
). Like this. -
The 4 corner cells has a capablity to hold max 1 element, edge cells (edges x length - corners i.e.
4*10-4=36
cells) have capablity to hold max 2 elements and all the other cells can have 3 elements max. One cell can con contain only same type of elements (i.e. all@
or all#
or all*
). -
In each turn a player places his element on his desired location which is either an empty cell or a cell which already consists of his element(s).
-
Every time a cell exceeds its capablity of number of elements it bursts horizontally left or right and vertically up or down. Each corner cell burst with 2 elements, edge cells with 3 and other cells with 4 elements.
-
When a cell bursts all elements in it scatters towards adjacent cells based on rule 4. The scattered elements then gallops the cell it goes to and make all the elements in making it of its color.
-
After each move this Bursting and galloping continues in chain till the whole grid reaches stability. When there is only one color (in my game symbol) present in the grid the owner of that color wins the game.
Future plan
- Add animation.
- Add dynamic grid size.
- Add multiplayer option.
Another attempt to optimize the code and the display: blocked.c
. The code is not yet complete.