I am working on a problem for which i have already developed a solution, but i am new to OPP prgramming and started learning recently.
Would request OPP Gurus to provide suggestions for the better designs, keeping scalability, extendability of (course readability) in mind.
Also,I would like to extend the the current program for mutiple random players and winner is decided based on max number of votes.
But there are rules:
1)Currently i have 6 players, out of which any number of players might contest(taken from std::input or cmd args)
2)Contestants are not aware of other contestants.
3)Each contestant has to send a message to other players,other players will give support to the contestant only if the sent message has that particular player symbol in it.( as done in findSymbol function).
4)Contestants are not allowed to give support , and other players will give support on FCFS basis.
5)Currently i have six players,if 3 pplayers wants to contest then three players will send 5 messages to other players, so 3*5 = 15 messages total.
6)There will a umpire who picks 6 messages(because currently only 6 players) and gives to all players based on message(because message has player name in it, can be found in createSecretMessage)
7)In case of two/more players get same votes then contest should be held for those players, till one gets majority or no one gets majority.
As message is choosen randomly there is a possibility that no one gets majority,then there wont be any winner, thats possible.
Its a mid size prgram , request to bear with me and provide your valueable suggestions, thanks in advance..
The below program does above steps but for only one player, so there wont be any ties etc..
since , the program is of little big in size I have divided into multiple posts:
below are related links:
http://www.cplusplus.com/forum/general/266968/
http://www.cplusplus.com/forum/general/266967/