Skip to content

kartikey369-ind/Snake-Water-Gun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Snake Water Gun Game Using C LANGUAGE:-

Snake Water Gun is one of the famous two-player game played by many people. It is a hand game in which the player randomly chooses any of the three forms i.e. snake, water, and gun. Here, we are going to implement this game using C LANG.

This C project is to build a game for a single player that plays with the computer.

c

Following are the rules of the game:

Snake vs. Water: Snake drinks the water hence wins.

Water vs. Gun: The gun will drown in water, hence a point for water

Gun vs. Snake: Gun will kill the snake and win.

In situations where both players choose the same object, the result will be a draw.

Srand function:

The srand function is used to seed the random number generator in C. When you call rand without seeding it, it will produce the same sequence of numbers each time you run the program. By using srand with a seed value that changes (such as the current time), you ensure that rand produces different sequences of random numbers on each execution.

In summary, srand is used to ensure that the random numbers generated by rand are different each time you run the program, which is crucial for games and simulations where true randomness is desired.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages