Posts

Showing posts from May, 2016

HOW TO CREATE TEXT GAMES USING C! : PART 1 (Using the rand() function)

Image
So, you might stumble upon this page while searching how to make simple text games using C. Here below is the first part of 'simple to understand' explanation of how you can create games using C! The most important characteristic of any game or match(both digital and physical) is its randomness in which actions or moves take place. That is what makes a game interesting Consider the classic rock paper scissors game! Here the fun lies in randomness of selection of options by both the players even though the number of choices is limited So if we could somehow get this characteristic into our program... Then we are very well on our way to making exciting games! So how do we bring randomness into our program? Well, for this very purpose, we have a predefined function under the 'stdlib.h' header file and the function name is rand() functionality of rand() : The rand() function generates a random pseudo-number between 0 and 32767 So how can we use