hashing the tiles in the 2r11-2048

while designing the 2r11-2048(just another 2048 game designed to play in your sweet terminal and written in C) i have encountered a bug in which insertrandom() function is been activating without any legal moves in other words without any change in the board. i thought of editing whole dragging and summing functions but then it occurred to me that i should try hashing. but i am unaware of hashing. so to keep things simple and as whole is board length is 16 i tried to make a string out of the board and strcmp the before and after the bunchcall() board to check any chaos in the board and it worked as magic.

and later i recognized that this bug made the game a little bit easier than before! so i headed for the original code and introduced this bug into it.

That’s how i made the game easier by editing a couple of lines. you can check out the game at here


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s