Skip to content
/ hex Public

Represents a game of Hex between two players

Notifications You must be signed in to change notification settings

emilyab3/hex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hex

C99 program called bob which simulates a game of Hex between two players

bob will display a grid of cells like thıs: . . . . . . . . . . . . . . . .

The two plàyers in the game will take turns putting “stones” into empty cells. The first player will indicate their stones with O and the second player will use X. The cells are numbered from the top left corner as 0,0 (row, then column). Note that columns are numbered from zero for the leftmost cell in each row, regardless of how far it is indented.

To win the game, a player needs to connect opposite sides of the grid. Player O aims to connect the left and right edges with Os, while Player X aims to connect top and bottom edges with Xs.

Each cell is considered adjacent to up to six other cells, so, in the picture below, the O would be directly connected to an O in any of the cells marked with ?. . . . . . ? ? . . ? O ? . . ? ?

In the game below, O wins by connecting left to right.. . . X . O O X . . O X X . . O O

About

Represents a game of Hex between two players

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages