From 48be87d4f05f21653db9f8b7c0b8f2cb212e2267 Mon Sep 17 00:00:00 2001 From: Adnan Valdes Date: Tue, 10 Jun 2025 09:19:07 +0200 Subject: [PATCH] Fix typos in 2-robot-and-boxes.md --- data/part-14/2-robot-and-boxes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/part-14/2-robot-and-boxes.md b/data/part-14/2-robot-and-boxes.md index f8fddb97..ab9a8ebb 100644 --- a/data/part-14/2-robot-and-boxes.md +++ b/data/part-14/2-robot-and-boxes.md @@ -128,7 +128,7 @@ If the execution of the method has reached this point without returning, it is t ## Refactoring? -Using only the grid to store the state of the game at all times is very handy in the sense that only one variable is permanently invlved in the whole process, and it is relatively easy to update the state of the grid through simple additions and subtractions. +Using only the grid to store the state of the game at all times is very handy in the sense that only one variable is permanently involved in the whole process, and it is relatively easy to update the state of the grid through simple additions and subtractions. The downside is that it can be a tad difficult to understand the program code of the game. If someone unfamiliar with the logic used saw this following line of code, they would likely be a bit perplexed: @@ -136,7 +136,7 @@ The downside is that it can be a tad difficult to understand the program code of if self.map[box_new_y][box_new_x] in [1, 3, 5]: ``` -The code snippet above makes use of _magic numbers_ to represent the squares in the grid. ANyone reading the code would have to know that 1 means wall, 3 means a box and 5 means a box in a target square. +The code snippet above makes use of _magic numbers_ to represent the squares in the grid. Anyone reading the code would have to know that 1 means wall, 3 means a box and 5 means a box in a target square. The lines involving the clever subtractions and additions would look even more baffling: