Git Product home page Git Product logo

gobang-game's Introduction

Gobang game

This is my first-ever programming project. It was my final assignment for Introduction to Computer Science course in my first semester at university.

It is a 13x13 grid Gobang game, with a simple AI simulation for the computer player. The game is written in C language.

The project includes 3 main C source code files (Functions.c, ComputerPlayer.c, and Game.c) and one library file (Library.h).

First, the "Library.h" file is where I list the structure(s) and functions needed for the game.

Second, the "Functions.c" file is where I define functions listed in "Library.h" file. The "InitialBoard" function is to print out the initial game board. The "DisplayBoard" function is to print out the game board after every time a player makes a move. The "Humanplay" function is to let the human player make a move. The "Firstplayer" and "Secondplayer" function are for two sides to make their move when two players play. The "IsWin" function is to check whether one side has won the game. The "IsFull" function is to check whether the game board is fully filled, if it is full then the game is tied. The "PrintWinner" function is to announce the winner when they won the game. The "save" function is to record every move that players made. The "Replay" function is to read the record that was saved and to print in the screen.

The "ComputerPlayer" file is made exclusively to intelligently programmed the computer to respond, attack and counter the opponent's move to make the game harder for the human player.

The "Game.c" file is where the game is implemented. It includes the main function and different modules to execute the game based on players' preferences. There are two main modules, one is human playing against human which is "twoplayer" function, and the other one is human playing against the computer, it is divided into two sub-modules, where the human player can choose the attacking position or the defending position.

gobang-game's People

Contributors

phuongbui2711 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.