Video: Refactoring a Battleship Game in Python // Code Roast Part 1 of 2

Channel: ArjanCodes

About

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.

Yes! Time for another Code Roast! In this video, I'm refactoring a Battleship game. I first analyze the code and then refactor it to make the code cleaner and easier to reuse. In this first part, I concentrate on making the code that reads user input more generic.

The code I worked on in this video is available here: https://github.com/ArjanCodes/2022-coderoast-battleship.

🎓 ArjanCodes Courses: https://www.arjancodes.com/courses/

🔖 Chapters:

0:00 Intro

1:13 Overview of the game code

4:22 Analysis of the code

12:26 Refactoring the user input mechanism

16:22 Refactoring the main function

18:22 Refactoring reading the player guesses

22:26 Updating the game logic method

24:18 Outro

#arjancodes #softwaredesign #python