Devam Ediyor

82326 BattleShips in C++

I am sure most of you have heard and maybe played this game before where two people place their ships on their own boards and each player take turn at guessing the location of the other player's ships, until all parts of one of the player's ships are bombed. The program will enable a user a play against computer. Should be relatively short codes less than 300 lines. Not written in O-O but in functions. I am sorry that it has to be done in 2 days, I list the project of monday and the project should be finish by thursday. The deadline is [url removed, login to view] AET (GMT+10). I was giving the project on another freelance but it was not satisfactory due to service provider is so slow on responding my email on final modification of the file. So I better have backup while waiting his email after 10 days unaswered. If you need further info, just open the PMB I'll get back to you in a matter of hours. It's an emergency situation. Please only bid if you can do it by thursday. I will certainly will start early for this project. If your works meets my requirement. I will use your service again next time because I am going to have an improved version of this battleships. Please open the PMB if you can do it quickly. From there we will get in touch. Payment: 50% start 50% finish. Anyway, check out the part below for full specs and previously made program by a freelance is attached. ----------- Copy and paste this part to your notepad if the interface looks wierd ----------- 1. Desired Interface +---------------------------------------------------------------------------------------+ | Battle Ships | +---------------------------------------------------------------------------------------+ | Player’s Ships and hits Player’s Turns and hits | | made by the Computer on the Computer’s Ships | +---------------------------------------------------------------------------------------+ | 1 2 3 4 5 1 2 3 4 5 | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 1 | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 2 | | S | S | S | | | | | | | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 3 | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 4 | S | | S | | | | | | | | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 5 | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | +---------------------------------------------------------------------------------------+ | ' ' = Empty S=Player's Ship X=Hit Ship M=Missed | +---------------------------------------------------------------------------------------+ | | | For your next move: Enter the ROW (1-5) = 3 (example) | | Enter the Column (1-5) = 2 (example) | +---------------------------------------------------------------------------------------+ 2. Example of the game Player's turn: You missed! CPU't turn: Gotcha! +---------------------------------------------------------------------------------------+ | Battle Ships | +---------------------------------------------------------------------------------------+ | Player’s Ships and hits Player’s Turns and hits | | made by the Computer on the Computer’s Ships | +---------------------------------------------------------------------------------------+ | 1 2 3 4 5 1 2 3 4 5 | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 1 | | | | | | | M | | M | | M | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 2 | M | X | X | X | M | | | M | M | | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 3 | M | M | M | | | | | M | | | M | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 4 | S | | X | | | | X | | M | M | X | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | | 5 | M | M | | | | | | M | M | M | | | | +-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+ | +---------------------------------------------------------------------------------------+ | ' ' = Empty S=Player's Ship X=Hit Ship M=Missed | +---------------------------------------------------------------------------------------+ | | | For your next move: Enter the ROW (1-5) = 3 (example) | | Enter the Column (1-5) = 2 (example) | +---------------------------------------------------------------------------------------+ 3. Functions (Priority) main function as follow: Initialize_Game while (game!=over) { Draw_Game_Board Get_Humas_Move Check_Game_status Get_Computers_Move Check_Game_Status } Break down of each function: 1. Initialize_Game Function to initialize the game, so that 5 X 5 grids of the player's moves, computer's moves, player's ships, and computer's ships are all empty. Then, 5 ships should Placed at random locations inside the player's ships and the computer's ships grids. Should use the current time to seed the random number generator. 2. Draw_Game_Board Function to draw the game 5 X 5 grid of the human's ships (and show where the computer has bombed and either missed or hit the player's ships) and 5 X 5 grid of the player's moves (and show where the human has bombed and either missed or hit the computer's ships) 3. Get_Humans_Move Function to prompt for, validate, and process a move for the player. Example: As the player to enter row and column seperated by comma or single space. The input should then be checked if it's valid (between 1 - 5) and free, if it is not then it should give error message and re-prompt for move. When a valid move has been received, then this function should check the how this affects the computer's ships and then update the human's moves grid with wither a hit or miss depending on the effect on the computer's ships. 4. Get_Computers_Move Function to determine a reasonable move for the computer player. This fucntion should keep looping through rows and column at random until a square is found where the computer has not yet bombed. Then the computer should bomb that, and then check the effects on the player's ships (and show where the computer has bombed and either missed or hit the human's ships). 5. Check_Game_Status Function to determine if we have a winner yet (either player has bombed all of the other players ships). No draw game. Added function: At the end of any games, the program should increment and displays the number of wins or losses for the player. Then the player should be prompted to play again, then the player who won the previous game (either player or CPU) should go first. Note: 1. Program is written in function not OO for DOS (CLI) not (GUI) 2. Good comments are essentials for future update or reference. (Priority) 3. 90% The interface and functionality will look the same from the .exe file attached on my scriptlance. 4. Avoid Global variables 5. From the attached .exe on my scriptlance. Here's the part I want to modified. The only thing that is need to be modified is the error message. So rather than popping out on the screen. I would rather have like when the user mistyped, the error message will be displayed undernearth the "Enter the column" as white text. or another option is to clear the screen then print the error message, user press any key then it will be back to the main interface. The error message is for when user type the number outside 1 to 5 and when the user enter the column and row that is already bombed. Also when the game is over, please add simple line like if the user is won,it comes up with "You just beat the CPU" Defeats: ..... Win: 1 or if the computer wins "You have been beaten!" Defeat: 1 Win:...... And I notice after I execute the file it creates a text file either .dat or .txt at this moment for 1st version of battleships. It does need to write to a file. So the winning or lossing is only stored to the memory. As long as the human player plays the game, all the winning and lossing data will be stored on mem. So once the human player exited the game and later on executed the game. All previous winning and lossing data will be cleared on first function which is Initializa game. ----------------------------------------- End here ----------------------------

Beceriler: Her şey Kabul, C Programlama

Daha fazlasını görün: write an article on computer, write an article freelance, win freelance, where to freelance in c++, where do people go for game freelance, where can i freelance, variables in programming, user interface freelance who is good, type copy freelance, the freelance game, t$c, stored program computer, start programming freelance, start freelance c#, simple programming freelance, simple computer programming, should i go freelance, service line freelance, scriptlance freelance, reference in computer programming, reasonable payment freelance, prompt freelance, project game freelance, program project freelance, programming variables

İşveren Hakkında:
( 57 değerlendirme ) Bandung, Indonesia

Proje NO: #1828967

Seçilen:

oligofren123

It could be done, so you want a console/ dos program. without oop. so it shiuld be c ot c++?

2 gün içinde 45$ USD
(0 Değerlendirme)
0.0