Handbook of Damage Control, NAVPERS 16191, 1945, was created near the end of World War II and represents best practices in WW II damage control. Included are three small amendments made in 1947, 19. General Specifications-Appendescribes the Nomenclature of decks, Numbering of watertight compartments and Labeling used aboard vessels of the U.S. (Some of these are provided as PDF files, if you have trouble reading these, Adobe® Acrobat® Reader is a Free Download.) Finding US Navy Records and Drawings at the U.S.Links To Full Text Documents On Other Web Sites.Navy Electricity and Electronics Training Series (NEETS) in PDF.Training Courses in PDF (includes aviation).Naval Ships' Technical Manuals (NSTM) in PDF.Booklet of General Plans (ships' drawings).Electricity, Communications, Sonar and Radar.Intelligence, Recognition Handbook, Photo Interpretation.Please contact us with the Mail Feedback Form with any corrections or additions. You can modify the code and add extra features and functionality.Īs I have said you can use an online compiler or run it on your computer if you don't have python setup then you can refer to this guide: Setting up python on a computer.Below are several full text declassified Navy documents of interest to researchers working on historic naval ships. It is made using python functions and if-else statements. """Will only be called when program is run from terminal or an IDE like P圜harms"""Ībove is the code for a battleship game in python. Print("Number of bullets left: " + str(bullets_left)) Print("Number of ships remaining: " + str(num_of_ships - num_of_ships_sunk)) Print("You have 50 bullets to take down 8 ships, may the battle begin!") """Main entry point of application that runs the game loop""" Print("Sorry, you lost! You ran out of bullets, try again next time!") """If all ships have been sunk or we run out of bullets its game over""" Row, col = accept_valid_bullet_placement() """Updates grid and ships based on where the bullet was shot""" If start_row <= row <= end_row and start_col <= col <= end_col: """If all parts of a shit have been shot it is sunk and we later increment ships sunk""" Print("You have already shot a bullet here, pick somewhere else") Print("Error: Please enter letter (A-J) for row and (0-9) for column") If not row.isalpha() or not col.isnumeric(): Print("Error: Please enter only one row and column such as A3") Placement = input("Enter row (A-J) and column (0-9) such as A3: ") """Will get valid row and column to place bullet shot""" """Will print the grid with rows A-J and columns 0-9""" If try_to_place_ship_on_grid(random_row, random_col, direction, ship_size): While num_of_ships_placed != num_of_ships:ĭirection = random.choice() Of different sizes in different directions""" """Will create a 10x10 grid and randomly place down ships Return validate_grid_and_place_ship(start_row, end_row, start_col, end_col) Start_row, end_row, start_col, end_col = row, row + 1, col, col + 1 """Based on direction will call helper method to try and place a ship on the grid""" Ship_positions.append()ĭef try_to_place_ship_on_grid(row, col, direction, length): """Will check the row or column to see if it is safe to place a ship there""" # Global variable for number of ships sunkĭef validate_grid_and_place_ship(start_row, end_row, start_col, end_col): # Global variable for number of ships to place "#" = water that was shot with bullet, a miss because it hit no ship "X" = part of ship that was hit with bulletĤ. If all ships are unearthed before using up all bullets, you winģ. The ship is in one of 4 directions, left, right, up, and downĦ. A ship cannot be placed diagonally, so if a shot hits the rest of For every shot that hits or misses it will show up in the gridĥ. You can choose a row and column such as A3 to indicate where to shootĤ. You will have 50 bullets to take down the ships that are placed downģ. A 10x10 grid will have 8 ships of variable length randomly placed aboutĢ. Pre-reqs: Loops, Strings, Arrays, 2D Arrays, Global Variables, Methodsġ. You can copy the code below and run it on your computer or you can use an online compiler. I have given the source code of this python battleship game below. You should try to do this if you fail to do this, don’t need to worry. This is an awesome python battleship project. This python battleship game is made with grids you have to enter the row and column of the battleship you want to destroy. This is a single-player battleship game in python it is console-based. You may find it difficult if you are a beginner, so read this article till the end. This python battleship project is an intermediate python project. Today in this tutorial I will show you how to make a python battleship game with source code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |