Giter Club home page Giter Club logo

projets4beggifoudinemmadi's Introduction

Hex Game Project

This project was assigned to the second year Computer Science students of Université Paul Sabatier. The task was to implement the Hex Game (a strategy board game played between two players on a hexagonal grid). The game was to be implemented in C (for the calculations) and in Java (for the interface). All the documents to turn in for the project are in the doc directory.

alt text

Our implementation includes the following functionnalities:

  • Choose the board size
  • Choose the player who will play first
  • Blocks illegal moves
  • Manages each player's turn
  • Detects a winner
  • Allows the players to quit with or without saving their game
  • Manages the history of previously saved games
  • Undo a move
  • Save a game, restore a game, forfeit a game

Compilation Instructions

In the InterfaceAvecC.java file in the ProjetS4BEGGIFOUDINEMMADI/code/codeJava/ directory, the library path must be modified. Thus the library must be generated according to your operationg system.

To generate the library change your working directory to ProjetS4BEGGIFOUDINEMMADI/lib/ and execute the following commands

For Linux:

$ gcc -I/usr/java/jdk1.5.0_01/include/
      -I/usr/java/jdk1.5.0_01/include/linux -c -fPIC InterfaceAvecC.c
$ gcc -shared -o libInterfaceAvecC.so InterfaceAvecC.o

For Mac:

$ gcc -I/Library/Java/Home/include/
      -I/Library/Java/Home/include/darwin -c InterfaceAvecC.c
$ gcc -shared -o libInterfaceAvecC.dylib InterfaceAvecC.o

For Windows

$ gcc -c -I"C:\j2sdk1.4.2_02\include"
         -I"C:\j2sdk1.4.2_02\include\win32"
         -o InterfaceAvecC.o TestJNI2.c
$ gcc -shared -o InterfaceAvecC.dll InterfaceAvecC.c InterfaceAvecC.c InterfaceAvecC.def

For solaris

$ cc -G -I/opt/JAVA/jdk1.5.0_01/include -I/opt/JAVA/jdk1.5.0_01/include/solaris InterfaceAvecC.c
     -o libInterfaceAvecC.so

! of course the java paths will vary depending on your installation

static {
  System.load("absolute/library/path");
}
  • To test and/or execute you must be in the project root.
  • To test the modules type: make TESTMODULE
  • To test the units type: make TESTUNITAIRE
  • To test the Artificial Intelligence (game against the computer): make TESTIA (attention: the AI mode does not test if a move is illegal or not)
  • To play the game against a human: make JAVA

projets4beggifoudinemmadi's People

Contributors

rainalexb avatar manzilane avatar ifoudinesara avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.