IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Threads & Processus C++ Discussion :

[debutant] jeu avec creation de processus et partage memoire


Sujet :

Threads & Processus C++

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2005
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2005
    Messages : 36
    Points : 17
    Points
    17
    Par défaut [debutant] jeu avec creation de processus et partage memoire
    Bonjour,
    je suis etudiant en informatique et j'effectue ma 3eme annee de licence en irlande.Je dois faire ce jeux en 1 semaines et je n'ai malheureusement jamais programme en C++.
    Un peu d'aide serait la bienvenue...

    Voici l'enonce en anglais bien entendu :s

    You are asked to build the infrastructure for a simple two player game system using shared memory and message queues for the communications under UNIX. The system will comprise of a GameController and two player processes. They will communicate using a combination of command line arguments (for setup), shared memory (for the current state of play), and message queues (to request that a player makes a move and to confirm that the player has made a move).

    You are being given 1 week to implement this assignment. This is an indication that there is a fair amount of work involved so you need to get started immediately. I will run a tutorial session after a week to discuss issues - but it will only be of use to those who have started work on the assignment.

    I would recommend that you develop the GameController first, as what it must do should be reasonably apparent from studying this assignment specification.
    A more formal specification:

    You are asked to build a system for supporting two player games as follows:

    * You must build your system by extending the code provided.
    * This assignment must be implemented under UNIX on the College computers (If you do it on your own machine make sure that it works on the machines in College before submitting it).
    * The game must be run using 3 processes: one for the GameController and one for each of the two players.
    * The GameController must take two command line arguments specifying the player programs (i.e. executable files)
    * The board must be stored as an area of shared memory which the GameController must create and then pass its ID to each of the player processes (as a command line argument) when it creates them.
    * Requests for players to take a move and confirmation that a player has taken a move must be sent as messages (on a message queue). The type of the message must be the player number (for requests) and CONFIRM_MOVE_MESSAGE_TYPE for confirmations.
    * The GameController must create the message queue and must pass its ID to each of the player processes (as a command line argument) when it creates them.
    * Each player should be asked for a move in turn but if no move is received within the allowed time (See CNoughtsAndCrosses::TimeAllowedForAMove()) then the game must be awarded to the other player.
    * If a player makes an invalid move the game must be awarded to his/her opponent.
    * The player processes must be killed, the shared memory deleted and the message queue deleted when the game is over.
    * If a player program cannot be started correctly the system must handle this gracefully (and not proceed with the game).

    Supplied:

    * PlayerUtilities.C & PlayerUtilities.h These files provide methods which allow player process to select and make a move.
    * Game.C & Game.h These files define a class on which any specific two person game can be built.
    * NoughtsAndCrosses.C & NoughtsAndCrosses.h These files implement the game of Noughts and Crosses.
    * NoughtsAndCrossesBoard.h This file defines a basic structure for the Noughts and Crosses board.
    * General.C & General.h These files just provide the syserr() facility.
    * Utilities.h This file defines some general purpose utilities for shared memory and message queues.
    * Makefile

    Partly supplied:

    * Controller.h (public methods only shown - add private methods/data as required)
    * Player.h (public methods only shown - add private methods/data as required)

    To be written:

    * Utilities.C Implement the methods defined in Utilities.h
    * Player.C Implement the Player class defined in Player.h
    * Controller.C Implement the Controller class defined in Controller.h
    * ContollerMain.C Create a mainline for the Game controller
    * PoorPlayer.C and/or PerfectPlayer.C (these should be virtually identical) These mainlines should each create a player process

    Voila maintenant plus de 5 heures que j'essaye de comprendre le C++ et le code mais je n'ai pas beaucoup avance.

    Si quelqu'un se sent de me sauver la vie ... lol et de me donner un coup de main je pourrai vous transmettre le code ....

    Merci ;D

  2. #2
    Expert éminent sénior

    Homme Profil pro
    pdg
    Inscrit en
    Juin 2003
    Messages
    5 753
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : pdg

    Informations forums :
    Inscription : Juin 2003
    Messages : 5 753
    Points : 10 704
    Points
    10 704
    Billets dans le blog
    3
    Par défaut
    Dis nous où tu bloques, on essayera de t'aider. Par contre si tu cherches à ce que quelqu'un te fasse ton devoir, c'est pas le bon endroit.

Discussions similaires

  1. Irrlicht 3D : Réaliser un jeu avec écran partagé
    Par LittleWhite dans le forum Développement 2D, 3D et Jeux
    Réponses: 0
    Dernier message: 12/06/2013, 22h19
  2. Avoir un exécutable partageable de mon jeu avec xCode
    Par Daxter06 dans le forum Développement 2D, 3D et Jeux
    Réponses: 1
    Dernier message: 03/12/2009, 11h14
  3. [DEBUTANT] probleme avec split ?
    Par matN59 dans le forum ASP
    Réponses: 6
    Dernier message: 23/10/2004, 15h47
  4. Réponses: 2
    Dernier message: 31/08/2004, 11h45
  5. [Debutant] Executable avec Jbuilder
    Par Stef784ever dans le forum JBuilder
    Réponses: 3
    Dernier message: 16/05/2003, 14h40

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo