So I want to make a code that keeps track of peoples scores when we play darts that is fairly organized.
I don't want someone to write the complete source code for me, since that would be very long anyways. However, I could use some pointers on how to go about it and what would be the best way to do it. I want to do this to get better with using functions, structures, array's etc. I have started writing part of it but I think going to scratch it and figure out better ways to go about it instead of typing a million lines that are not necessary.
Sorry for the crappy algorithm but this is the just of what I want it to do.
Dart code Algorithm
I want it to:
Ask how many people are playing(will need an int size)
Validate input
If more than one person is playing then ask for users names(array or structure)
Validate the input for names can’t be longer than 12 characters(string array names)
Save each players name.
Ask for what is the starting score(maybe struct players.scores)
Validate between 1 and 999(cons int maxscore and gamescore)
If its valid display the the menu:
(
********darts*******
1.Player calculator
{
If the player calculator is chosen then ask which player is trying to use it
Validate that is a current player.
Show the players total (struct name.score)
Ask how much it wants to subtract
Validate whether they busted or not
If they bust then set them back to their original score before that
Tell them they busted and display their total again
else if there score is zero then say they won and ask to play again.
else if they didn't bust display there current standing
Display their new score and go back to the menu
}
2.View player scores
{
Display every ones scores and wait for user to exit.
}
3.Restart
{
Break out of the loop and ask for players etc. again
}
4.Quit
{
End the program
}
Display whose turn it is.
)