Skip to content

prithivichithran/Grid_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Introduction :

  • The game is created using c language.

Demo :

Try out HERE

Description :

  • This is a typical game created using C language.

  • This game is easy to play.

  • This game is has a 3 X 3 matrix type format.

Rules :

  • User Should use w,a,s&d keys.
  • w is used for Moving the values up,
  • s is used for Moving the values down,
  • a is used for Moving the values left,
  • d is used for Moving the values right.
  • Users must finish the game in way such that values are in ascending order

Screenshots :

  • Game Starts in format like below as in numbers in scrambled order.

gamedemo

  • User Should Change Values Using Specified rules and finish game like below.

gamedemo1

Concepts Used :

Array :

  • Here Array is used to store the Hard Coded Values of the grid.
  • In this code we use both Single and Multi Dimensional Array.
  • Single Dimensional Array is used for storing index value for the position of zero in grid.
  • Multi Dimensional Array is used for storing,swapping & printing the grid values.

Function :

  • Function is used to reduce the code complexity.
  • Here we use more than one function.

For Loop:

  • For loop is used to print grid values.
  • It is also used to find the position of zero .

While loop:

  • It is used to run and swap values until the values are in ascending order.

Switch Case:

  • It is used to get the moves from user and to appropriately swap them in the grid.

Releases

No releases published

Packages

No packages published

Languages