Programmation c++

Résolu/Fermé
samcanada - 5 janv. 2008 à 22:24
mamiemando Messages postés 33135 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 4 juin 2024 - 6 janv. 2008 à 04:15
Bonjour,
j'ai un code a faire en c++, ca fait longtemps que j'ai pas programmé avec ce langage, je vous copie et colle le sujet du tp, et je serais reconnaissant de votre aide ou au moins une idee pour le prgrammer ;

Your program should be able to check whether a user selection is valid or not, it should also determine whether the user won, or there is a draw (nobody won), and terminate.
To implement this programm you need an array of 9 characters to keep track of the state of the board. Initially, the array is initialized from
1 to 9. The user's selection is stored as X, and program's selection is stored as O

You need functions to do the followinf :

1- display the board using the state information available in the array of 9 characters.
2-check whether s move is valid or not.
3-check for a sequence of O or X in anay row,column,or diagonal, to detect if the user or program has won.
4-check weather to terminate the program because there no more moves possible.
5-generate a new move randomly; however, your porgram must as well make smart moves.
A voir également:

1 réponse

mamiemando Messages postés 33135 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 4 juin 2024 7 756
6 janv. 2008 à 04:15
Ce qui aurait été sympa c'est de nous traduire le sujet, afin qu'un maximum de personne puisse t'aider. Accessoirement en général sur le forum on débloque quelqu'un sur un point précis (souscis d'implémentation, problème de compréhension) mais on fait rarement les exercices de quelqu'un à sa place.

Reformule le sujet, donne ce que tu as commencé à faire et ce qui te bloque, et on t'aidera ;-)

Bon courage
0